aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/builtin_macro.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-21 16:11:21 +0100
committerGitHub <[email protected]>2021-06-21 16:11:21 +0100
commit56e61bdfea5454dec4408a4947e037bcd042c886 (patch)
tree0bc42cbfcf5b6b502ad9fc3079cb4bdc5e8f110f /crates/hir_expand/src/builtin_macro.rs
parent25bf451c8426a68ecfdc3a1d1be1db9702dd41d8 (diff)
parent47747cd4120e260a144242aadd7732e11d133fe4 (diff)
Merge #9165
9165: Apply some clippy suggestions r=matklad a=clemenswasser Co-authored-by: Clemens Wasser <[email protected]>
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