Small code improvements in guide.

This commit is contained in:
Sergio Benitez 2017-07-02 01:37:50 -07:00
parent a6e01f97c1
commit a6d03b1e2f
2 changed files with 3 additions and 3 deletions

View File

@ -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())
}
```

View File

@ -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())
}
```