Skip to content

Commit 6369331

Browse files
committed
Small grammar fix
1 parent ea0014c commit 6369331

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

crates/ide_assists/src/handlers/remove_unused_param.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@ pub(crate) fn remove_unused_param(acc: &mut Assists, ctx: &AssistContext) -> Opt
5353
}
5454

5555
let mut param_position = func.param_list()?.params().position(|it| it == param)?;
56-
// param_list() does not take self param into consideration, hence this additional check is
57-
// added. There are two cases to handle in this scenario, where functions are
58-
// associative(functions not associative and not containting contain self, are not allowed), in
59-
// this case param position is rightly set. If a method call is present which has self param,
60-
// that needs to be handled and is added below in process_usage function to reduce this increment and
61-
// not consider self param.
56+
// param_list() does not take the self param into consideration, hence this additional check
57+
// is required. For associated functions, param_position is incremented here. For inherent
58+
// calls we revet the increment below, in process_usage, as those calls will not have an
59+
// explicit self parameter.
6260
if is_self_present {
6361
param_position += 1;
6462
}

crates/ide_db/src/path_transform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'a> Ctx<'a> {
105105
s.param_list().is_some() || (s.self_token().is_some() && path.parent_path().is_none())
106106
}) {
107107
// don't try to qualify `Fn(Foo) -> Bar` paths, they are in prelude anyway
108-
// don't try to qualify sole `self` either, they are usually locals, but are returned as modules due to namespace classing
108+
// don't try to qualify sole `self` either, they are usually locals, but are returned as modules due to namespace clashing
109109
return None;
110110
}
111111

0 commit comments

Comments
 (0)