File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -448,8 +448,8 @@ impl<'db> SemanticsImpl<'db> {
448
448
}
449
449
450
450
fn resolve_derive_macro ( & self , attr : & ast:: Attr ) -> Option < Vec < MacroDef > > {
451
- let macro_call_ids = self . derive_macro_calls ( attr ) ? ;
452
- let res = macro_call_ids
451
+ let res = self
452
+ . derive_macro_calls ( attr ) ?
453
453
. iter ( )
454
454
. map ( |& call| {
455
455
let loc: MacroCallLoc = self . db . lookup_intern_macro_call ( call) ;
@@ -460,9 +460,8 @@ impl<'db> SemanticsImpl<'db> {
460
460
}
461
461
462
462
fn expand_derive_macro ( & self , attr : & ast:: Attr ) -> Option < Vec < SyntaxNode > > {
463
- let macro_call_ids = self . derive_macro_calls ( attr) ?;
464
-
465
- let expansions: Vec < _ > = macro_call_ids
463
+ let res: Vec < _ > = self
464
+ . derive_macro_calls ( attr) ?
466
465
. iter ( )
467
466
. map ( |call| call. as_file ( ) )
468
467
. flat_map ( |file_id| {
@@ -471,12 +470,7 @@ impl<'db> SemanticsImpl<'db> {
471
470
Some ( node)
472
471
} )
473
472
. collect ( ) ;
474
-
475
- if expansions. is_empty ( ) {
476
- None
477
- } else {
478
- Some ( expansions)
479
- }
473
+ Some ( res)
480
474
}
481
475
482
476
fn derive_macro_calls ( & self , attr : & ast:: Attr ) -> Option < Vec < MacroCallId > > {
You can’t perform that action at this time.
0 commit comments