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 == '&');
|
.span_take_while(span, |c| c.is_whitespace() || *c == '&');
|
||||||
if points_at_arg && mutability.is_not() && refs_number > 0 {
|
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 we have a call like foo(&mut buf), then don't suggest foo(&mut mut buf)
|
||||||
if "mut"
|
if snippet
|
||||||
== snippet
|
.trim_start_matches(|c: char| c.is_whitespace() || c == '&')
|
||||||
.chars()
|
.starts_with("mut")
|
||||||
.filter(|c| !c.is_whitespace())
|
|
||||||
.skip(refs_number)
|
|
||||||
.take(3)
|
|
||||||
.collect::<String>()
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user