Merge #9706
9706: minor: perf and grammar fixes r=lnicola a=lnicola Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
8232804d3e
4 changed files with 7 additions and 12 deletions
|
|
@ -75,10 +75,7 @@ impl InferenceContext<'_> {
|
|||
safety: chalk_ir::Safety::Safe,
|
||||
variadic: false,
|
||||
},
|
||||
substitution: FnSubst(Substitution::from_iter(
|
||||
&Interner,
|
||||
sig_tys.clone(),
|
||||
)),
|
||||
substitution: FnSubst(Substitution::from_iter(&Interner, sig_tys)),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)?;
|
||||
// param_list() does not take self param into consideration, hence this additional check is
|
||||
// added. There are two cases to handle in this scenario, where functions are
|
||||
// associative(functions not associative and not containting contain self, are not allowed), in
|
||||
// this case param position is rightly set. If a method call is present which has self param,
|
||||
// that needs to be handled and is added below in process_usage function to reduce this increment and
|
||||
// not consider self param.
|
||||
// param_list() does not take the self param into consideration, hence this additional check
|
||||
// is required. For associated functions, param_position is incremented here. For inherent
|
||||
// calls we revet the increment below, in process_usage, as those calls will not have an
|
||||
// explicit self parameter.
|
||||
if is_self_present {
|
||||
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())
|
||||
}) {
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@ impl GlobalState {
|
|||
let mut text = String::from_utf8(vfs.file_contents(file_id).to_vec()).unwrap();
|
||||
apply_document_changes(&mut text, params.content_changes);
|
||||
|
||||
vfs.set_file_contents(path.clone(), Some(text.into_bytes()));
|
||||
vfs.set_file_contents(path, Some(text.into_bytes()));
|
||||
}
|
||||
Ok(())
|
||||
})?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue