diff --git a/crates/ide_completion/src/render/function.rs b/crates/ide_completion/src/render/function.rs index 82688cfae6..6032b28fc6 100644 --- a/crates/ide_completion/src/render/function.rs +++ b/crates/ide_completion/src/render/function.rs @@ -137,10 +137,12 @@ pub(super) fn add_call_parens<'b>( } None => { let name = match param.ty().as_adt() { - Some(adt) => { - to_lower_snake_case(&adt.name(ctx.db).as_text().unwrap()) - } None => "_".to_string(), + Some(adt) => adt + .name(ctx.db) + .as_text() + .map(to_lower_snake_case) + .unwrap_or("_".to_string()), }; f(&format_args!("${{{}:{}}}", index + offset, name)) }