aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/builtin_macro.rs
diff options
context:
space:
mode:
authorClemens Wasser <[email protected]>2021-06-07 12:59:01 +0100
committerClemens Wasser <[email protected]>2021-06-21 15:40:21 +0100
commit47747cd4120e260a144242aadd7732e11d133fe4 (patch)
treeba767d7da808c050e313446ac4cb90d810d0f4de /crates/hir_expand/src/builtin_macro.rs
parent4402f2b280f58896ed0696f4243d88a58fd970ca (diff)
Apply some clippy suggestions
Diffstat (limited to 'crates/hir_expand/src/builtin_macro.rs')
-rw-r--r--crates/hir_expand/src/builtin_macro.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs
index 4c83a2efe..f556bc751 100644
--- a/crates/hir_expand/src/builtin_macro.rs
+++ b/crates/hir_expand/src/builtin_macro.rs
@@ -420,7 +420,7 @@ fn parse_string(tt: &tt::Subtree) -> Result<String, mbe::ExpandError> {
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(mbe::ExpandError::ConversionError)
424} 424}
425 425
426fn include_expand( 426fn include_expand(
@@ -432,9 +432,8 @@ fn include_expand(
432 let path = parse_string(tt)?; 432 let path = parse_string(tt)?;
433 let file_id = relative_file(db, arg_id, &path, false)?; 433 let file_id = relative_file(db, arg_id, &path, false)?;
434 434
435 let subtree = parse_to_token_tree(&db.file_text(file_id)) 435 let subtree =
436 .ok_or_else(|| mbe::ExpandError::ConversionError)? 436 parse_to_token_tree(&db.file_text(file_id)).ok_or(mbe::ExpandError::ConversionError)?.0;
437 .0;
438 Ok((subtree, file_id)) 437 Ok((subtree, file_id))
439 })(); 438 })();
440 439