mirror of https://github.com/rwf2/Rocket.git
Small code improvements in guide.
This commit is contained in:
parent
a6e01f97c1
commit
a6d03b1e2f
|
@ -307,8 +307,8 @@ simple as possible via the
|
|||
|
||||
```rust
|
||||
#[post("/upload", format = "text/plain", data = "<data>")]
|
||||
fn upload(data: Data) -> io::Result<Plain<String>> {
|
||||
data.stream_to_file("/tmp/upload.txt").map(|n| Plain(n.to_string()))
|
||||
fn upload(data: Data) -> io::Result<String> {
|
||||
data.stream_to_file("/tmp/upload.txt").map(|n| n.to_string())
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ return a type of `status::Accepted<String>`:
|
|||
```rust
|
||||
#[get("/")]
|
||||
fn accept() -> status::Accepted<String> {
|
||||
status::Accepted(Some("I accept!".to_string()))
|
||||
status::Accepted("I accept!".to_string())
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue