File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ impl Extensions {
61
61
/// ```
62
62
pub fn insert < T : Clone + Send + Sync + ' static > ( & mut self , val : T ) -> Option < T > {
63
63
self . map
64
- . get_or_insert_with ( || Box :: new ( HashMap :: default ( ) ) )
64
+ . get_or_insert_with ( Box :: default)
65
65
. insert ( TypeId :: of :: < T > ( ) , Box :: new ( val) )
66
66
. and_then ( |boxed| boxed. into_any ( ) . downcast ( ) . ok ( ) . map ( |boxed| * boxed) )
67
67
}
@@ -138,7 +138,7 @@ impl Extensions {
138
138
) -> & mut T {
139
139
let out = self
140
140
. map
141
- . get_or_insert_with ( || Box :: new ( HashMap :: default ( ) ) )
141
+ . get_or_insert_with ( Box :: default)
142
142
. entry ( TypeId :: of :: < T > ( ) )
143
143
. or_insert_with ( || Box :: new ( f ( ) ) ) ;
144
144
( * * out) . as_any_mut ( ) . downcast_mut ( ) . unwrap ( )
Original file line number Diff line number Diff line change @@ -434,7 +434,7 @@ impl<'a> TryFrom<&'a [u8]> for Authority {
434
434
435
435
// Preconditon on create_authority: copy_from_slice() copies all of
436
436
// bytes from the [u8] parameter into a new Bytes
437
- create_authority ( s, |s| Bytes :: copy_from_slice ( s ) )
437
+ create_authority ( s, Bytes :: copy_from_slice)
438
438
}
439
439
}
440
440
You can’t perform that action at this time.
0 commit comments