mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Clippy-fix explicit auto-deref
Seems like these can be safely fixed. With one, I was particularly surprised -- `Some(pats) => &**pats,` in body.rs? ``` cargo clippy --fix -- -A clippy::all -D clippy::explicit_auto_deref ```
This commit is contained in:
parent
f1785f7a21
commit
e341e996f7
20 changed files with 22 additions and 22 deletions
|
@ -372,7 +372,7 @@ impl Body {
|
|||
/// Retrieves all ident patterns this pattern shares the ident with.
|
||||
pub fn ident_patterns_for<'slf>(&'slf self, pat: &'slf PatId) -> &'slf [PatId] {
|
||||
match self.or_pats.get(pat) {
|
||||
Some(pats) => &**pats,
|
||||
Some(pats) => pats,
|
||||
None => std::slice::from_ref(pat),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ pub struct ScopeData {
|
|||
impl ExprScopes {
|
||||
pub(crate) fn expr_scopes_query(db: &dyn DefDatabase, def: DefWithBodyId) -> Arc<ExprScopes> {
|
||||
let body = db.body(def);
|
||||
let mut scopes = ExprScopes::new(&*body);
|
||||
let mut scopes = ExprScopes::new(&body);
|
||||
scopes.shrink_to_fit();
|
||||
Arc::new(scopes)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue