aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/builtin_macro.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_expand/src/builtin_macro.rs')
-rw-r--r--crates/hir_expand/src/builtin_macro.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs
index 0b310ba2f..51572226e 100644
--- a/crates/hir_expand/src/builtin_macro.rs
+++ b/crates/hir_expand/src/builtin_macro.rs
@@ -354,7 +354,7 @@ fn concat_expand(
354 // concat works with string and char literals, so remove any quotes. 354 // concat works with string and char literals, so remove any quotes.
355 // It also works with integer, float and boolean literals, so just use the rest 355 // It also works with integer, float and boolean literals, so just use the rest
356 // as-is. 356 // as-is.
357 let component = unquote_str(&it).unwrap_or_else(|| it.text.to_string()); 357 let component = unquote_str(it).unwrap_or_else(|| it.text.to_string());
358 text.push_str(&component); 358 text.push_str(&component);
359 } 359 }
360 // handle boolean literals 360 // handle boolean literals
@@ -417,7 +417,7 @@ fn parse_string(tt: &tt::Subtree) -> Result<String, mbe::ExpandError> {
417 tt.token_trees 417 tt.token_trees
418 .get(0) 418 .get(0)
419 .and_then(|tt| match tt { 419 .and_then(|tt| match tt {
420 tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => unquote_str(&it), 420 tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => unquote_str(it),
421 _ => None, 421 _ => None,
422 }) 422 })
423 .ok_or_else(|| mbe::ExpandError::ConversionError) 423 .ok_or_else(|| mbe::ExpandError::ConversionError)
@@ -561,7 +561,7 @@ mod tests {
561 use syntax::ast::NameOwner; 561 use syntax::ast::NameOwner;
562 562
563 fn expand_builtin_macro(ra_fixture: &str) -> String { 563 fn expand_builtin_macro(ra_fixture: &str) -> String {
564 let (db, file_id) = TestDB::with_single_file(&ra_fixture); 564 let (db, file_id) = TestDB::with_single_file(ra_fixture);
565 let parsed = db.parse(file_id); 565 let parsed = db.parse(file_id);
566 let mut macro_rules: Vec<_> = 566 let mut macro_rules: Vec<_> =
567 parsed.syntax_node().descendants().filter_map(ast::MacroRules::cast).collect(); 567 parsed.syntax_node().descendants().filter_map(ast::MacroRules::cast).collect();