Clean up mut keyword check
This commit is contained in:
parent
9c8bf51f14
commit
afefbb66c3
@ -1369,13 +1369,9 @@ fn suggest_change_mut(
|
||||
.span_take_while(span, |c| c.is_whitespace() || *c == '&');
|
||||
if points_at_arg && mutability.is_not() && refs_number > 0 {
|
||||
// If we have a call like foo(&mut buf), then don't suggest foo(&mut mut buf)
|
||||
if "mut"
|
||||
== snippet
|
||||
.chars()
|
||||
.filter(|c| !c.is_whitespace())
|
||||
.skip(refs_number)
|
||||
.take(3)
|
||||
.collect::<String>()
|
||||
if snippet
|
||||
.trim_start_matches(|c: char| c.is_whitespace() || c == '&')
|
||||
.starts_with("mut")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user