From 0fe44d099ad7cf9c8699e41ece424fda84bce999 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 20 Feb 2021 14:45:30 -0800 Subject: Stop mixing Result and Option with ? in inline_local_variable Depending on the discussion in RFC#3058 this might not end up being necessary, but I think it's a reasonable change regardless. --- crates/assists/src/handlers/inline_local_variable.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/assists/src/handlers') diff --git a/crates/assists/src/handlers/inline_local_variable.rs b/crates/assists/src/handlers/inline_local_variable.rs index 9b228443f..da5522670 100644 --- a/crates/assists/src/handlers/inline_local_variable.rs +++ b/crates/assists/src/handlers/inline_local_variable.rs @@ -78,10 +78,10 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O usage_node.syntax().parent().and_then(ast::Expr::cast); let usage_parent = match usage_parent_option { Some(u) => u, - None => return Ok(false), + None => return Some(false), }; - Ok(!matches!( + Some(!matches!( (&initializer_expr, usage_parent), (ast::Expr::CallExpr(_), _) | (ast::Expr::IndexExpr(_), _) @@ -107,10 +107,10 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O | (_, ast::Expr::MatchExpr(_)) )) }) - .collect::>() + .collect::>() .map(|b| (file_id, b)) }) - .collect::>, _>>()?; + .collect::>>>()?; let init_str = initializer_expr.syntax().text().to_string(); let init_in_paren = format!("({})", &init_str); -- cgit v1.2.3