Use RequestPartsExt more in docs / examples (#1445)

* Use RequestPartsExt more in docs / examples

* Remove unused import
This commit is contained in:
Jonas Platte
2022-10-04 17:26:51 +00:00
committed by GitHub
parent a57bd9a118
commit a7d8954178
7 changed files with 31 additions and 31 deletions
+2 -4
View File
@@ -17,7 +17,7 @@ use axum::{
},
response::IntoResponse,
routing::get,
Router,
RequestPartsExt, Router,
};
use serde::{Deserialize, Serialize};
use std::fmt::Debug;
@@ -91,9 +91,7 @@ where
async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> {
let store = MemoryStore::from_ref(state);
let cookie = Option::<TypedHeader<Cookie>>::from_request_parts(parts, state)
.await
.unwrap();
let cookie: Option<TypedHeader<Cookie>> = parts.extract().await.unwrap();
let session_cookie = cookie
.as_ref()