Fix a few minor mistakes in the guide.

This commit is contained in:
Paul van Tilburg 2021-06-15 21:08:36 +02:00 committed by Jeb Rosen
parent c3dc7183f3
commit c1b14084f9
2 changed files with 5 additions and 4 deletions

View File

@ -211,7 +211,7 @@ there are no remaining routes to try. When there are no remaining routes, a
customizable **404 error** is returned. customizable **404 error** is returned.
Routes are attempted in increasing _rank_ order. Rocket chooses a default Routes are attempted in increasing _rank_ order. Rocket chooses a default
ranking from -6 to -1, detailed in the next section, but a route's rank can also ranking from -12 to -1, detailed in the next section, but a route's rank can also
be manually set with the `rank` attribute. To illustrate, consider the following be manually set with the `rank` attribute. To illustrate, consider the following
routes: routes:
@ -781,6 +781,7 @@ fn new(task: Option<Form<Task<'_>>>) { /* .. */ }
[`Form`]: @api/rocket/form/struct.Form.html [`Form`]: @api/rocket/form/struct.Form.html
[`FromForm`]: @api/rocket/form/trait.FromForm.html [`FromForm`]: @api/rocket/form/trait.FromForm.html
[`FromFormField`]: @api/rocket/form/trait.FromFormField.html
### Parsing Strategy ### Parsing Strategy
@ -1734,7 +1735,7 @@ fn hello(name: &str, color: Vec<Color>, person: Person<'_>, other: Option<usize>
// A request with these query segments matches as above. // A request with these query segments matches as above.
# rocket_guide_tests::client(routes![hello]).get("/?\ # rocket_guide_tests::client(routes![hello]).get("/?\
color=reg&\ color=red&\
color=green&\ color=green&\
person.pet.name=Fi+Fo+Alex&\ person.pet.name=Fi+Fo+Alex&\
color=green&\ color=green&\

View File

@ -649,8 +649,8 @@ generated.
```rust ```rust
# #[macro_use] extern crate rocket; # #[macro_use] extern crate rocket;
# #[get("/<id>/<name>?<age>")] #[get("/<id>/<name>?<age>")]
# fn person(id: Option<usize>, name: &str, age: Option<u8>) { /* .. */ } fn person(id: Option<usize>, name: &str, age: Option<u8>) { /* .. */ }
/// Note that `id` is `Option<usize>` in the route, but `id` in `uri!` _cannot_ /// Note that `id` is `Option<usize>` in the route, but `id` in `uri!` _cannot_
/// be an `Option`. `age`, on the other hand, _must_ be an `Option` (or `Result` /// be an `Option`. `age`, on the other hand, _must_ be an `Option` (or `Result`