Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/replace_try_expr_with_match.rs')
-rw-r--r--crates/ide-assists/src/handlers/replace_try_expr_with_match.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/ide-assists/src/handlers/replace_try_expr_with_match.rs b/crates/ide-assists/src/handlers/replace_try_expr_with_match.rs
index 3fd59f3b69..c6e864fcfd 100644
--- a/crates/ide-assists/src/handlers/replace_try_expr_with_match.rs
+++ b/crates/ide-assists/src/handlers/replace_try_expr_with_match.rs
@@ -61,10 +61,13 @@ pub(crate) fn replace_try_expr_with_match(
TryEnum::Option => {
make::expr_return(Some(make::expr_path(make::ext::ident_path("None"))))
}
- TryEnum::Result => make::expr_return(Some(make::expr_call(
- make::expr_path(make::ext::ident_path("Err")),
- make::arg_list(iter::once(make::expr_path(make::ext::ident_path("err")))),
- ))),
+ TryEnum::Result => make::expr_return(Some(
+ make::expr_call(
+ make::expr_path(make::ext::ident_path("Err")),
+ make::arg_list(iter::once(make::expr_path(make::ext::ident_path("err")))),
+ )
+ .into(),
+ )),
};
let happy_arm = make::match_arm(