From 47747cd4120e260a144242aadd7732e11d133fe4 Mon Sep 17 00:00:00 2001 From: Clemens Wasser Date: Mon, 7 Jun 2021 13:59:01 +0200 Subject: Apply some clippy suggestions --- crates/hir_expand/src/builtin_macro.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/hir_expand/src/builtin_macro.rs') 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 { tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => unquote_str(it), _ => None, }) - .ok_or_else(|| mbe::ExpandError::ConversionError) + .ok_or(mbe::ExpandError::ConversionError) } fn include_expand( @@ -432,9 +432,8 @@ fn include_expand( let path = parse_string(tt)?; let file_id = relative_file(db, arg_id, &path, false)?; - let subtree = parse_to_token_tree(&db.file_text(file_id)) - .ok_or_else(|| mbe::ExpandError::ConversionError)? - .0; + let subtree = + parse_to_token_tree(&db.file_text(file_id)).ok_or(mbe::ExpandError::ConversionError)?.0; Ok((subtree, file_id)) })(); -- cgit v1.2.3