mirror of https://github.com/rwf2/Rocket.git
Change 'cookies' to 'mut cookies' in the guide, as required to call 'get_private'.
Fixes #1095.
This commit is contained in:
parent
e7e84a6d41
commit
14ee05b9a1
|
@ -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()))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue