Change 'cookies' to 'mut cookies' in the guide, as required to call 'get_private'.

Fixes #1095.
This commit is contained in:
Jeb Rosen 2019-08-22 10:12:32 -07:00
parent e7e84a6d41
commit 14ee05b9a1
1 changed files with 1 additions and 1 deletions

View File

@ -538,7 +538,7 @@ methods are suffixed with `_private`. These methods are: [`get_private`],
```rust
/// Retrieve the user's ID, if any.
#[get("/user_id")]
fn user_id(cookies: Cookies) -> Option<String> {
fn user_id(mut cookies: Cookies) -> Option<String> {
cookies.get_private("user_id")
.map(|cookie| format!("User ID: {}", cookie.value()))
}