Skip to content

Commit a6be402

Browse files
committed
fix clippy warning
1 parent 67bb045 commit a6be402

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/handling/request_handler.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::mem::transmute;
21
use std::sync::Arc;
2+
use std::{io, mem::transmute};
33

44
use ahash::HashMap;
55
use http_body_util::{BodyExt, Full};
@@ -61,13 +61,9 @@ fn setup_session_request(
6161
let headers = &request.headers;
6262
if let Some(ref store) = session_store {
6363
let session_id = extract_session_id_from_cookie(headers.get("cookie"), &store.cookie_name);
64-
65-
let session = store.get_session(session_id).map_err(|e| {
66-
Box::new(std::io::Error::new(
67-
std::io::ErrorKind::Other,
68-
format!("Failed to get session: {}", e),
69-
))
70-
})?;
64+
let session = store
65+
.get_session(session_id)
66+
.map_err(|e| Box::new(io::Error::other(format!("Failed to get session: {}", e))))?;
7167
request.session = Some(Arc::new(session));
7268
request.session_store = Some(store.clone());
7369
}

src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl Session {
228228
let data = self.data.read().into_py_exception()?;
229229
match data.get(key) {
230230
Some(value) => Ok(value.clone_ref(py)),
231-
None => Err(pyo3::exceptions::PyKeyError::new_err(key.to_string())),
231+
_ => Err(pyo3::exceptions::PyKeyError::new_err(key.to_string())),
232232
}
233233
}
234234

0 commit comments

Comments
 (0)