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:
bors 2023-05-24 11:13:52 +00:00
commit 2df56cadcb
10 changed files with 71 additions and 30 deletions

View file

@ -370,8 +370,7 @@ impl ast::BlockExpr {
match parent.kind() {
FOR_EXPR | IF_EXPR => parent
.children()
.filter(|it| ast::Expr::can_cast(it.kind()))
.next()
.find(|it| ast::Expr::can_cast(it.kind()))
.map_or(true, |it| it == *self.syntax()),
LET_ELSE | FN | WHILE_EXPR | LOOP_EXPR | CONST_BLOCK_PAT => false,
_ => true,

View file

@ -195,7 +195,7 @@ pub fn ty_alias(
}
}
s.push_str(";");
s.push(';');
ast_from_text(&s)
}
@ -399,7 +399,7 @@ pub fn hacky_block_expr(
format_to!(buf, " {t}\n")
} else if kind == SyntaxKind::WHITESPACE {
let content = t.text().trim_matches(|c| c != '\n');
if content.len() >= 1 {
if !content.is_empty() {
format_to!(buf, "{}", &content[1..])
}
}