mirror of https://github.com/rwf2/Rocket.git
337e8843a4
Prior to this commit, the conversion 'T -> Option<T>' was applied in both the path and query parts of a URI in the 'uri' macro via the 'FromUriParam' trait with no implementation for 'Option<T>' directly. This meant that it was impossible to directly render an 'Option<T>'. This was exactly desired for the path part, where rendering a 'None' would yield an incorrect URI, but the restriction was too strict for the query part, where a 'None' is entirely valid. This commit makes changes the conversion so that it only applied to path parts and adds the identity conversions for 'Option<T>' and 'Result<T, E>' for query parts. The side effect is a breaking change: due to conflicting impls, the 'T' to 'Option<T>' conversion was removed for query parts. Thus, all 'uri!' query route arguments of type 'Option' or 'Result' must now be wrapped in 'Some' or 'Ok'. Due to new 'Option<T> <-> Result<T, E>' conversions, either 'Some' _and_ 'Ok' work in both contexts. Closes #1420. |
||
---|---|---|
.. | ||
async-entry.rs | ||
async-entry.stderr | ||
bad-ignored-segments.rs | ||
bad-ignored-segments.stderr | ||
catch.rs | ||
catch.stderr | ||
catch_type_errors.rs | ||
catch_type_errors.stderr | ||
catchers.rs | ||
catchers.stderr | ||
from_form.rs | ||
from_form.stderr | ||
from_form_type_errors.rs | ||
from_form_type_errors.stderr | ||
from_form_value.rs | ||
from_form_value.stderr | ||
responder-types.rs | ||
responder-types.stderr | ||
responder.stderr | ||
route-attribute-general-syntax.rs | ||
route-attribute-general-syntax.stderr | ||
route-path-bad-syntax.rs | ||
route-path-bad-syntax.stderr | ||
route-type-errors.rs | ||
route-type-errors.stderr | ||
route-warnings.rs | ||
route-warnings.stderr | ||
routes.rs | ||
routes.stderr | ||
typed-uri-bad-type.rs | ||
typed-uri-bad-type.stderr | ||
typed-uris-bad-params.rs | ||
typed-uris-bad-params.stderr | ||
typed-uris-invalid-syntax.rs | ||
typed-uris-invalid-syntax.stderr | ||
uri_display.rs | ||
uri_display.stderr | ||
uri_display_type_errors.rs | ||
uri_display_type_errors.stderr |