clippy::redudant_borrow

This commit is contained in:
Maan2003 2021-06-13 09:24:16 +05:30
parent d6737e55fb
commit c9b4ac5be4
No known key found for this signature in database
GPG key ID: E9AF024BA63C70ED
114 changed files with 285 additions and 285 deletions

View file

@ -288,7 +288,7 @@ fn runnable_action(
) -> Option<HoverAction> {
match def {
Definition::ModuleDef(it) => match it {
ModuleDef::Module(it) => runnable_mod(&sema, it).map(|it| HoverAction::Runnable(it)),
ModuleDef::Module(it) => runnable_mod(sema, it).map(|it| HoverAction::Runnable(it)),
ModuleDef::Function(func) => {
let src = func.source(sema.db)?;
if src.file_id != file_id.into() {
@ -297,7 +297,7 @@ fn runnable_action(
return None;
}
runnable_fn(&sema, func).map(HoverAction::Runnable)
runnable_fn(sema, func).map(HoverAction::Runnable)
}
_ => None,
},
@ -432,7 +432,7 @@ fn hover_for_definition(
return match def {
Definition::Macro(it) => match &it.source(db)?.value {
Either::Left(mac) => {
let label = macro_label(&mac);
let label = macro_label(mac);
from_def_source_labeled(db, it, Some(label), mod_path)
}
Either::Right(_) => {
@ -516,7 +516,7 @@ fn hover_for_keyword(
if !token.kind().is_keyword() {
return None;
}
let famous_defs = FamousDefs(&sema, sema.scope(&token.parent()?).krate());
let famous_defs = FamousDefs(sema, sema.scope(&token.parent()?).krate());
// std exposes {}_keyword modules with docstrings on the root to document keywords
let keyword_mod = format!("{}_keyword", token.text());
let doc_owner = find_std_module(&famous_defs, &keyword_mod)?;