From 95c8c65139c10e4de44367fead8dff88511e6d46 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 17 Jun 2021 17:37:14 +0200 Subject: Nest all the or-patterns! --- crates/hir_expand/src/hygiene.rs | 9 +++++---- crates/hir_expand/src/lib.rs | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'crates/hir_expand') diff --git a/crates/hir_expand/src/hygiene.rs b/crates/hir_expand/src/hygiene.rs index 05c6c3fb1..848522411 100644 --- a/crates/hir_expand/src/hygiene.rs +++ b/crates/hir_expand/src/hygiene.rs @@ -146,10 +146,11 @@ impl HygieneInfo { (&self.macro_arg.1, InFile::new(loc.kind.file_id(), arg_start)) } mbe::Origin::Def => match (&*self.macro_def, self.def_start) { - (TokenExpander::MacroDef { def_site_token_map, .. }, Some(tt)) - | (TokenExpander::MacroRules { def_site_token_map, .. }, Some(tt)) => { - (def_site_token_map, tt) - } + ( + TokenExpander::MacroDef { def_site_token_map, .. } + | TokenExpander::MacroRules { def_site_token_map, .. }, + Some(tt), + ) => (def_site_token_map, tt), _ => panic!("`Origin::Def` used with non-`macro_rules!` macro"), }, }; diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index 33107aa24..c31426d7c 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs @@ -368,10 +368,11 @@ impl ExpansionInfo { let (token_map, tt) = match origin { mbe::Origin::Call => (&self.macro_arg.1, self.arg.clone()), mbe::Origin::Def => match (&*self.macro_def, self.def.as_ref()) { - (db::TokenExpander::MacroRules { def_site_token_map, .. }, Some(tt)) - | (db::TokenExpander::MacroDef { def_site_token_map, .. }, Some(tt)) => { - (def_site_token_map, tt.as_ref().map(|tt| tt.syntax().clone())) - } + ( + db::TokenExpander::MacroRules { def_site_token_map, .. } + | db::TokenExpander::MacroDef { def_site_token_map, .. }, + Some(tt), + ) => (def_site_token_map, tt.as_ref().map(|tt| tt.syntax().clone())), _ => panic!("`Origin::Def` used with non-`macro_rules!` macro"), }, }; -- cgit v1.2.3