From 12e3b4c70b5ef23b2fdfc197296d483680e125f9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 8 Feb 2019 14:49:43 +0300 Subject: reformat the world --- crates/ra_mbe/src/lib.rs | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'crates/ra_mbe/src/lib.rs') diff --git a/crates/ra_mbe/src/lib.rs b/crates/ra_mbe/src/lib.rs index 2c8ad4429..b09837831 100644 --- a/crates/ra_mbe/src/lib.rs +++ b/crates/ra_mbe/src/lib.rs @@ -137,18 +137,12 @@ impl_froms!(TokenTree: Leaf, Subtree); "#; let source_file = ast::SourceFile::parse(macro_definition); - let macro_definition = source_file - .syntax() - .descendants() - .find_map(ast::MacroCall::cast) - .unwrap(); + let macro_definition = + source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); let source_file = ast::SourceFile::parse(macro_invocation); - let macro_invocation = source_file - .syntax() - .descendants() - .find_map(ast::MacroCall::cast) - .unwrap(); + let macro_invocation = + source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); let definition_tt = ast_to_token_tree(macro_definition.token_tree().unwrap()).unwrap(); let invocation_tt = ast_to_token_tree(macro_invocation.token_tree().unwrap()).unwrap(); @@ -163,11 +157,8 @@ impl_froms!(TokenTree: Leaf, Subtree); fn create_rules(macro_definition: &str) -> MacroRules { let source_file = ast::SourceFile::parse(macro_definition); - let macro_definition = source_file - .syntax() - .descendants() - .find_map(ast::MacroCall::cast) - .unwrap(); + let macro_definition = + source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); let definition_tt = ast_to_token_tree(macro_definition.token_tree().unwrap()).unwrap(); crate::MacroRules::parse(&definition_tt).unwrap() @@ -175,11 +166,8 @@ impl_froms!(TokenTree: Leaf, Subtree); fn assert_expansion(rules: &MacroRules, invocation: &str, expansion: &str) { let source_file = ast::SourceFile::parse(invocation); - let macro_invocation = source_file - .syntax() - .descendants() - .find_map(ast::MacroCall::cast) - .unwrap(); + let macro_invocation = + source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); let invocation_tt = ast_to_token_tree(macro_invocation.token_tree().unwrap()).unwrap(); -- cgit v1.2.3