Skip to content

Commit 85ead6e

Browse files
committed
remove other unwraps
1 parent f64eecd commit 85ead6e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/ide-assists/src/handlers/generate_function.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,11 @@ impl FunctionBuilder {
404404
leading_ws,
405405
ret_type: fn_def.ret_type(),
406406
// PANIC: we guarantee we always create a function body with a tail expr
407-
tail_expr: fn_def.body().unwrap().tail_expr().unwrap(),
407+
tail_expr: fn_def
408+
.body()
409+
.expect("generated function should have a body")
410+
.tail_expr()
411+
.expect("function body should have a tail expression"),
408412
should_focus_return_type: self.should_focus_return_type,
409413
fn_def,
410414
trailing_ws,

0 commit comments

Comments
 (0)