remove other unwraps

This commit is contained in:
Milo 2023-09-25 11:48:23 +00:00
parent f64eecd2e2
commit 85ead6ec27

View File

@ -404,7 +404,11 @@ fn render(self, is_method: bool) -> FunctionTemplate {
leading_ws,
ret_type: fn_def.ret_type(),
// PANIC: we guarantee we always create a function body with a tail expr
tail_expr: fn_def.body().unwrap().tail_expr().unwrap(),
tail_expr: fn_def
.body()
.expect("generated function should have a body")
.tail_expr()
.expect("function body should have a tail expression"),
should_focus_return_type: self.should_focus_return_type,
fn_def,
trailing_ws,