File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use crate :: config;
4
4
use crate :: db:: { connection_url, make_manager_config, ConnectionConfig } ;
5
- use std:: ops:: Deref ;
6
5
use std:: sync:: Arc ;
7
6
8
7
use crate :: email:: Emails ;
@@ -12,6 +11,7 @@ use crate::storage::Storage;
12
11
use axum:: extract:: { FromRef , FromRequestParts , State } ;
13
12
use crates_io_github:: GitHubClient ;
14
13
use deadpool_diesel:: Runtime ;
14
+ use derive_more:: Deref ;
15
15
use diesel_async:: pooled_connection:: deadpool:: Pool as DeadpoolPool ;
16
16
use diesel_async:: pooled_connection:: AsyncDieselConnectionManager ;
17
17
use diesel_async:: AsyncPgConnection ;
@@ -206,19 +206,10 @@ impl App {
206
206
}
207
207
}
208
208
209
- #[ derive( Clone , FromRequestParts ) ]
209
+ #[ derive( Clone , FromRequestParts , Deref ) ]
210
210
#[ from_request( via( State ) ) ]
211
211
pub struct AppState ( pub Arc < App > ) ;
212
212
213
- // deref so you can still access the inner fields easily
214
- impl Deref for AppState {
215
- type Target = App ;
216
-
217
- fn deref ( & self ) -> & Self :: Target {
218
- & self . 0
219
- }
220
- }
221
-
222
213
impl FromRef < AppState > for cookie:: Key {
223
214
fn from_ref ( app : & AppState ) -> Self {
224
215
app. session_key ( ) . clone ( )
You can’t perform that action at this time.
0 commit comments