File tree 4 files changed +5
-16
lines changed
4 files changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ impl ser::Serialize for Target {
285
285
edition : & self . edition ( ) . to_string ( ) ,
286
286
required_features : self
287
287
. required_features ( )
288
- . map ( |rf| rf. iter ( ) . map ( |s| & * * s ) . collect ( ) ) ,
288
+ . map ( |rf| rf. iter ( ) . map ( |s| s . as_str ( ) ) . collect ( ) ) ,
289
289
doc : self . documented ( ) ,
290
290
doctest : self . doctested ( ) && self . doctestable ( ) ,
291
291
test : self . tested ( ) ,
Original file line number Diff line number Diff line change @@ -271,20 +271,12 @@ impl<'src> SourceMap<'src> {
271
271
272
272
/// Like `HashMap::get`.
273
273
pub fn get ( & self , id : SourceId ) -> Option < & ( dyn Source + ' src ) > {
274
- let source = self . map . get ( & id) ;
275
-
276
- source. map ( |s| {
277
- let s: & ( dyn Source + ' src ) = & * * s;
278
- s
279
- } )
274
+ self . map . get ( & id) . map ( |s| s. as_ref ( ) )
280
275
}
281
276
282
277
/// Like `HashMap::get_mut`.
283
278
pub fn get_mut ( & mut self , id : SourceId ) -> Option < & mut ( dyn Source + ' src ) > {
284
- self . map . get_mut ( & id) . map ( |s| {
285
- let s: & mut ( dyn Source + ' src ) = & mut * * s;
286
- s
287
- } )
279
+ self . map . get_mut ( & id) . map ( |s| s. as_mut ( ) )
288
280
}
289
281
290
282
/// Like `HashMap::get`, but first calculates the `SourceId` from a `PackageId`.
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ fn resolve_to_string_orig(
96
96
f. read_to_string ( & mut s) ?;
97
97
Ok ( s)
98
98
} ) ;
99
- let out = serialize_resolve ( resolve, orig. as_ref ( ) . ok ( ) . map ( |s| & * * s ) ) ;
99
+ let out = serialize_resolve ( resolve, orig. as_deref ( ) . ok ( ) ) ;
100
100
( orig. ok ( ) , out, ws_root)
101
101
}
102
102
Original file line number Diff line number Diff line change @@ -74,10 +74,7 @@ fn sync(
74
74
opts : & VendorOptions < ' _ > ,
75
75
) -> CargoResult < VendorConfig > {
76
76
let canonical_destination = opts. destination . canonicalize ( ) ;
77
- let canonical_destination = canonical_destination
78
- . as_ref ( )
79
- . map ( |p| & * * p)
80
- . unwrap_or ( opts. destination ) ;
77
+ let canonical_destination = canonical_destination. as_deref ( ) . unwrap_or ( opts. destination ) ;
81
78
82
79
paths:: create_dir_all ( & canonical_destination) ?;
83
80
let mut to_remove = HashSet :: new ( ) ;
You can’t perform that action at this time.
0 commit comments