mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Auto merge of #14755 - poliorcetics:clippy-fixes, r=Veykril
Fix: a TODO and some clippy fixes - fix(todo): implement IntoIterator for ArenaMap<IDX, V> - chore: remove unused method - fix: remove useless `return`s - fix: various clippy lints - fix: simplify boolean test to a single negation
This commit is contained in:
commit
2df56cadcb
10 changed files with 71 additions and 30 deletions
|
@ -35,11 +35,10 @@ pub(super) fn print_body_hir(db: &dyn DefDatabase, body: &Body, owner: DefWithBo
|
|||
DefWithBodyId::VariantId(it) => {
|
||||
let src = it.parent.child_source(db);
|
||||
let variant = &src.value[it.local_id];
|
||||
let name = match &variant.name() {
|
||||
match &variant.name() {
|
||||
Some(name) => name.to_string(),
|
||||
None => "_".to_string(),
|
||||
};
|
||||
format!("{name}")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -456,7 +455,7 @@ impl<'a> Printer<'a> {
|
|||
fn print_block(
|
||||
&mut self,
|
||||
label: Option<&str>,
|
||||
statements: &Box<[Statement]>,
|
||||
statements: &[Statement],
|
||||
tail: &Option<la_arena::Idx<Expr>>,
|
||||
) {
|
||||
self.whitespace();
|
||||
|
@ -466,7 +465,7 @@ impl<'a> Printer<'a> {
|
|||
w!(self, "{{");
|
||||
if !statements.is_empty() || tail.is_some() {
|
||||
self.indented(|p| {
|
||||
for stmt in &**statements {
|
||||
for stmt in statements {
|
||||
p.print_stmt(stmt);
|
||||
}
|
||||
if let Some(tail) = tail {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue