mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Small grammar fix
This commit is contained in:
parent
ea0014c500
commit
636933153d
2 changed files with 5 additions and 7 deletions
|
@ -53,12 +53,10 @@ pub(crate) fn remove_unused_param(acc: &mut Assists, ctx: &AssistContext) -> Opt
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut param_position = func.param_list()?.params().position(|it| it == param)?;
|
let mut param_position = func.param_list()?.params().position(|it| it == param)?;
|
||||||
// param_list() does not take self param into consideration, hence this additional check is
|
// param_list() does not take the self param into consideration, hence this additional check
|
||||||
// added. There are two cases to handle in this scenario, where functions are
|
// is required. For associated functions, param_position is incremented here. For inherent
|
||||||
// associative(functions not associative and not containting contain self, are not allowed), in
|
// calls we revet the increment below, in process_usage, as those calls will not have an
|
||||||
// this case param position is rightly set. If a method call is present which has self param,
|
// explicit self parameter.
|
||||||
// that needs to be handled and is added below in process_usage function to reduce this increment and
|
|
||||||
// not consider self param.
|
|
||||||
if is_self_present {
|
if is_self_present {
|
||||||
param_position += 1;
|
param_position += 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ impl<'a> Ctx<'a> {
|
||||||
s.param_list().is_some() || (s.self_token().is_some() && path.parent_path().is_none())
|
s.param_list().is_some() || (s.self_token().is_some() && path.parent_path().is_none())
|
||||||
}) {
|
}) {
|
||||||
// don't try to qualify `Fn(Foo) -> Bar` paths, they are in prelude anyway
|
// don't try to qualify `Fn(Foo) -> Bar` paths, they are in prelude anyway
|
||||||
// don't try to qualify sole `self` either, they are usually locals, but are returned as modules due to namespace classing
|
// don't try to qualify sole `self` either, they are usually locals, but are returned as modules due to namespace clashing
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue