mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-17 10:18:31 +00:00
commit
001607fdb4
1 changed files with 2 additions and 2 deletions
|
@ -34,8 +34,8 @@ pub(crate) fn add_return_type(acc: &mut Assists, ctx: &AssistContext<'_>) -> Opt
|
|||
|builder| {
|
||||
match builder_edit_pos {
|
||||
InsertOrReplace::Insert(insert_pos, needs_whitespace) => {
|
||||
let preceeding_whitespace = if needs_whitespace { " " } else { "" };
|
||||
builder.insert(insert_pos, format!("{preceeding_whitespace}-> {ty} "))
|
||||
let preceding_whitespace = if needs_whitespace { " " } else { "" };
|
||||
builder.insert(insert_pos, format!("{preceding_whitespace}-> {ty} "))
|
||||
}
|
||||
InsertOrReplace::Replace(text_range) => {
|
||||
builder.replace(text_range, format!("-> {ty}"))
|
||||
|
|
Loading…
Reference in a new issue