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. |
||
---|---|---|
.. | ||
0-introduction.md | ||
1-quickstart.md | ||
2-getting-started.md | ||
3-overview.md | ||
4-requests.md | ||
5-responses.md | ||
6-state.md | ||
7-fairings.md | ||
8-testing.md | ||
9-configuration.md | ||
10-pastebin.md | ||
11-conclusion.md | ||
index.md |