File tree Expand file tree Collapse file tree 6 files changed +15
-15
lines changed Expand file tree Collapse file tree 6 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ impl CookieData {
90
90
}
91
91
}
92
92
93
- CookieData {
93
+ Self {
94
94
content : Arc :: new ( RwLock :: new ( jar) ) ,
95
95
}
96
96
}
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ impl<State> Request<State> {
32
32
state : Arc < State > ,
33
33
request : http_types:: Request ,
34
34
route_params : Vec < Params > ,
35
- ) -> Request < State > {
36
- Request {
35
+ ) -> Self {
36
+ Self {
37
37
state,
38
38
request,
39
39
route_params,
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ impl Response {
174
174
pub async fn body_form < T : serde:: Serialize > (
175
175
mut self ,
176
176
form : T ,
177
- ) -> Result < Response , serde_qs:: Error > {
177
+ ) -> Result < Self , serde_qs:: Error > {
178
178
// TODO: think about how to handle errors
179
179
self . res . set_body ( serde_qs:: to_string ( & form) ?. into_bytes ( ) ) ;
180
180
Ok ( self
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ pub(crate) struct Selection<'a, State> {
22
22
}
23
23
24
24
impl < State : ' static > Router < State > {
25
- pub ( crate ) fn new ( ) -> Router < State > {
26
- Router {
25
+ pub ( crate ) fn new ( ) -> Self {
26
+ Self {
27
27
method_map : HashMap :: default ( ) ,
28
28
all_method_router : MethodRouter :: new ( ) ,
29
29
}
Original file line number Diff line number Diff line change @@ -213,15 +213,15 @@ pub enum Origin {
213
213
impl From < String > for Origin {
214
214
fn from ( s : String ) -> Self {
215
215
if s == "*" {
216
- return Origin :: Any ;
216
+ return Self :: Any ;
217
217
}
218
- Origin :: Exact ( s)
218
+ Self :: Exact ( s)
219
219
}
220
220
}
221
221
222
222
impl From < & str > for Origin {
223
223
fn from ( s : & str ) -> Self {
224
- Origin :: from ( s. to_string ( ) )
224
+ Self :: from ( s. to_string ( ) )
225
225
}
226
226
}
227
227
@@ -231,13 +231,13 @@ impl From<Vec<String>> for Origin {
231
231
return Self :: from ( list[ 0 ] . clone ( ) ) ;
232
232
}
233
233
234
- Origin :: List ( list)
234
+ Self :: List ( list)
235
235
}
236
236
}
237
237
238
238
impl From < Vec < & str > > for Origin {
239
239
fn from ( list : Vec < & str > ) -> Self {
240
- Origin :: from (
240
+ Self :: from (
241
241
list. iter ( )
242
242
. map ( |s| ( * s) . to_string ( ) )
243
243
. collect :: < Vec < String > > ( ) ,
Original file line number Diff line number Diff line change @@ -151,13 +151,13 @@ impl Server<()> {
151
151
/// # Ok(()) }) }
152
152
/// ```
153
153
#[ must_use]
154
- pub fn new ( ) -> Server < ( ) > {
154
+ pub fn new ( ) -> Self {
155
155
Self :: with_state ( ( ) )
156
156
}
157
157
}
158
158
159
159
impl Default for Server < ( ) > {
160
- fn default ( ) -> Server < ( ) > {
160
+ fn default ( ) -> Self {
161
161
Self :: new ( )
162
162
}
163
163
}
@@ -194,8 +194,8 @@ impl<State: Send + Sync + 'static> Server<State> {
194
194
/// #
195
195
/// # Ok(()) }) }
196
196
/// ```
197
- pub fn with_state ( state : State ) -> Server < State > {
198
- let mut server = Server {
197
+ pub fn with_state ( state : State ) -> Self {
198
+ let mut server = Self {
199
199
router : Arc :: new ( Router :: new ( ) ) ,
200
200
middleware : Arc :: new ( vec ! [ ] ) ,
201
201
state : Arc :: new ( state) ,
You can’t perform that action at this time.
0 commit comments