We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f64eecd commit 85ead6eCopy full SHA for 85ead6e
crates/ide-assists/src/handlers/generate_function.rs
@@ -404,7 +404,11 @@ impl FunctionBuilder {
404
leading_ws,
405
ret_type: fn_def.ret_type(),
406
// PANIC: we guarantee we always create a function body with a tail expr
407
- tail_expr: fn_def.body().unwrap().tail_expr().unwrap(),
+ 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"),
412
should_focus_return_type: self.should_focus_return_type,
413
fn_def,
414
trailing_ws,
0 commit comments