diff options
Diffstat (limited to 'crates/assists/src/handlers/inline_local_variable.rs')
-rw-r--r-- | crates/assists/src/handlers/inline_local_variable.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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 | |||
78 | usage_node.syntax().parent().and_then(ast::Expr::cast); | 78 | usage_node.syntax().parent().and_then(ast::Expr::cast); |
79 | let usage_parent = match usage_parent_option { | 79 | let usage_parent = match usage_parent_option { |
80 | Some(u) => u, | 80 | Some(u) => u, |
81 | None => return Ok(false), | 81 | None => return Some(false), |
82 | }; | 82 | }; |
83 | 83 | ||
84 | Ok(!matches!( | 84 | Some(!matches!( |
85 | (&initializer_expr, usage_parent), | 85 | (&initializer_expr, usage_parent), |
86 | (ast::Expr::CallExpr(_), _) | 86 | (ast::Expr::CallExpr(_), _) |
87 | | (ast::Expr::IndexExpr(_), _) | 87 | | (ast::Expr::IndexExpr(_), _) |
@@ -107,10 +107,10 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O | |||
107 | | (_, ast::Expr::MatchExpr(_)) | 107 | | (_, ast::Expr::MatchExpr(_)) |
108 | )) | 108 | )) |
109 | }) | 109 | }) |
110 | .collect::<Result<_, _>>() | 110 | .collect::<Option<_>>() |
111 | .map(|b| (file_id, b)) | 111 | .map(|b| (file_id, b)) |
112 | }) | 112 | }) |
113 | .collect::<Result<FxHashMap<_, Vec<_>>, _>>()?; | 113 | .collect::<Option<FxHashMap<_, Vec<_>>>>()?; |
114 | 114 | ||
115 | let init_str = initializer_expr.syntax().text().to_string(); | 115 | let init_str = initializer_expr.syntax().text().to_string(); |
116 | let init_in_paren = format!("({})", &init_str); | 116 | let init_in_paren = format!("({})", &init_str); |