File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
- use std:: mem:: transmute;
2
1
use std:: sync:: Arc ;
2
+ use std:: { io, mem:: transmute} ;
3
3
4
4
use ahash:: HashMap ;
5
5
use http_body_util:: { BodyExt , Full } ;
@@ -61,13 +61,9 @@ fn setup_session_request(
61
61
let headers = & request. headers ;
62
62
if let Some ( ref store) = session_store {
63
63
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) ) ) ) ?;
71
67
request. session = Some ( Arc :: new ( session) ) ;
72
68
request. session_store = Some ( store. clone ( ) ) ;
73
69
}
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ impl Session {
228
228
let data = self . data . read ( ) . into_py_exception ( ) ?;
229
229
match data. get ( key) {
230
230
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 ( ) ) ) ,
232
232
}
233
233
}
234
234
You can’t perform that action at this time.
0 commit comments