mirror of https://github.com/rwf2/Rocket.git
Fix a few grammar issues in guide.
This commit is contained in:
parent
55459db773
commit
47485dbadd
|
@ -94,7 +94,7 @@ events is described below:
|
||||||
A response callback is called when a response is ready to be sent to the
|
A response callback is called when a response is ready to be sent to the
|
||||||
client. A response callback can modify part or all of the response. As such,
|
client. A response callback can modify part or all of the response. As such,
|
||||||
a response fairing can be used to provide a response when the greater
|
a response fairing can be used to provide a response when the greater
|
||||||
applications fails to by rewriting **404** responses as desired. As another
|
application fails by rewriting **404** responses as desired. As another
|
||||||
example, response fairings can also be used to inject headers into all
|
example, response fairings can also be used to inject headers into all
|
||||||
outgoing responses.
|
outgoing responses.
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ fn new(id: usize) -> status::Accepted<String> {
|
||||||
Similarly, the types in the [`content`
|
Similarly, the types in the [`content`
|
||||||
module](https://api.rocket.rs/rocket/response/content/index.html) can be used to
|
module](https://api.rocket.rs/rocket/response/content/index.html) can be used to
|
||||||
override the Content-Type of a response. For instance, to set the Content-Type
|
override the Content-Type of a response. For instance, to set the Content-Type
|
||||||
an `&'static str` to JSON, you can use the [`content::Json`] type as follows:
|
of `&'static str` to JSON, you can use the [`content::Json`] type as follows:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use rocket::response::content;
|
use rocket::response::content;
|
||||||
|
@ -125,7 +125,7 @@ fn handler() -> &'static str {
|
||||||
|
|
||||||
### `Option`
|
### `Option`
|
||||||
|
|
||||||
`Option` is _wrapping_ responder: an `Option<T>` can only be returned when `T`
|
`Option` is a _wrapping_ responder: an `Option<T>` can only be returned when `T`
|
||||||
implements `Responder`. If the `Option` is `Some`, the wrapped responder is used
|
implements `Responder`. If the `Option` is `Some`, the wrapped responder is used
|
||||||
to respond to the client. Otherwise, a error of **404 - Not Found** is returned
|
to respond to the client. Otherwise, a error of **404 - Not Found** is returned
|
||||||
to the client.
|
to the client.
|
||||||
|
|
Loading…
Reference in New Issue