From d19ebca68584043dab8864eba9a1d3db9bbe5d1e Mon Sep 17 00:00:00 2001 From: Arne Bahlo Date: Wed, 9 Aug 2017 22:31:22 +0200 Subject: [PATCH] Fix database usage code in state guide: '&*conn'. --- site/guide/state.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/guide/state.md b/site/guide/state.md index 70765903..ebe9ce3f 100644 --- a/site/guide/state.md +++ b/site/guide/state.md @@ -242,7 +242,7 @@ single connection from the managed connection pool. We create a new type, `DbConn`, that wraps an `r2d2` pooled connection. We then implement `FromRequest` for `DbConn` so that we can use it as a request guard. Finally, we implement `Deref` with a target of `SqliteConnection` so that we can -transparently use an `&DbConn` as an `&SqliteConnection`. +transparently use an `&*DbConn` as an `&SqliteConnection`. ```rust use std::ops::Deref; @@ -289,7 +289,7 @@ array of some `Task` structures that are fetched from a database: #[get("/tasks")] fn get_tasks(conn: DbConn) -> QueryResult>> { all_tasks.order(tasks::id.desc()) - .load::(&conn) + .load::(&*conn) .map(|tasks| Json(tasks)) } ```