File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,9 @@ impl<'de, S: BuildHasher + Default> Visitor<'de> for MapVisitor<S> {
47
47
fn visit_str < E : serde:: de:: Error > ( self , value : & str ) -> Result < Self :: Value , E > {
48
48
Ok ( value
49
49
. split ( [ '\n' , ',' ] )
50
- . map ( |s| {
51
- match s. split_once ( '=' ) {
52
- Some ( ( key, value) ) => ( key. to_owned ( ) , Some ( value. to_owned ( ) ) ) ,
53
- None => ( s. to_owned ( ) , None ) ,
54
- }
50
+ . map ( |s| match s. split_once ( '=' ) {
51
+ Some ( ( key, value) ) => ( key. to_owned ( ) , Some ( value. to_owned ( ) ) ) ,
52
+ None => ( s. to_owned ( ) , None ) ,
55
53
} )
56
54
. collect ( ) )
57
55
}
Original file line number Diff line number Diff line change @@ -77,11 +77,7 @@ impl<'a> RustAnalyzer<'a> {
77
77
let editioned_file_id = semantics
78
78
. attach_first_edition ( file_id)
79
79
. ok_or ( "failed to determine rust edition" ) ?;
80
- Ok ( (
81
- semantics,
82
- editioned_file_id,
83
- input,
84
- ) )
80
+ Ok ( ( semantics, editioned_file_id, input) )
85
81
}
86
82
}
87
83
}
Original file line number Diff line number Diff line change @@ -292,16 +292,14 @@ impl<'a> Translator<'a> {
292
292
if let Some ( value) = semantics
293
293
. hir_file_for ( expanded)
294
294
. macro_file ( )
295
- . and_then ( |macro_call_id| {
296
- semantics
297
- . db
298
- . parse_macro_expansion_error ( macro_call_id)
299
- } )
295
+ . and_then ( |macro_call_id| semantics. db . parse_macro_expansion_error ( macro_call_id) )
300
296
{
301
297
if let Some ( err) = & value. err {
302
298
let error = err. render_to_string ( semantics. db ) ;
303
299
let hir_file_id = semantics. hir_file_for ( node. syntax ( ) ) ;
304
- if Some ( err. span ( ) . anchor . file_id . file_id ( ) ) == hir_file_id. file_id ( ) . map ( |f| f. file_id ( semantics. db ) ) {
300
+ if Some ( err. span ( ) . anchor . file_id . file_id ( ) )
301
+ == hir_file_id. file_id ( ) . map ( |f| f. file_id ( semantics. db ) )
302
+ {
305
303
let location = err. span ( ) . range
306
304
+ semantics
307
305
. db
You can’t perform that action at this time.
0 commit comments