mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Some clippy fixes for 1.36
This commit is contained in:
parent
c6a6e43372
commit
4ad9e986ad
31 changed files with 62 additions and 70 deletions
|
@ -150,7 +150,7 @@ impl BodySourceMap {
|
|||
}
|
||||
|
||||
pub(crate) fn field_syntax(&self, expr: ExprId, field: usize) -> AstPtr<ast::NamedField> {
|
||||
self.field_map[&(expr, field)].clone()
|
||||
self.field_map[&(expr, field)]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -471,15 +471,15 @@ impl Pat {
|
|||
match self {
|
||||
Pat::Range { .. } | Pat::Lit(..) | Pat::Path(..) | Pat::Wild | Pat::Missing => {}
|
||||
Pat::Bind { subpat, .. } => {
|
||||
subpat.iter().map(|pat| *pat).for_each(f);
|
||||
subpat.iter().copied().for_each(f);
|
||||
}
|
||||
Pat::Tuple(args) | Pat::TupleStruct { args, .. } => {
|
||||
args.iter().map(|pat| *pat).for_each(f);
|
||||
args.iter().copied().for_each(f);
|
||||
}
|
||||
Pat::Ref { pat, .. } => f(*pat),
|
||||
Pat::Slice { prefix, rest, suffix } => {
|
||||
let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter());
|
||||
total_iter.map(|pat| *pat).for_each(f);
|
||||
total_iter.copied().for_each(f);
|
||||
}
|
||||
Pat::Struct { args, .. } => {
|
||||
args.iter().map(|f| f.pat).for_each(f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue