diff options
| author | bors <bors@rust-lang.org> | 2023-05-24 11:13:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-24 11:13:52 +0000 |
| commit | 2df56cadcb3496c8e076c91c3518cf55df4d7de1 (patch) | |
| tree | e580bef5a621ff3236b6926aa919cab28b6a7821 /crates/parser/src | |
| parent | 1d1a1195f39b973e7bf64fff853826c28838917f (diff) | |
| parent | 541183676781c8633ef6a2ed3d2847367acf6c5b (diff) | |
| download | rust-2df56cadcb3496c8e076c91c3518cf55df4d7de1.tar.gz rust-2df56cadcb3496c8e076c91c3518cf55df4d7de1.zip | |
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
Diffstat (limited to 'crates/parser/src')
| -rw-r--r-- | crates/parser/src/grammar/expressions.rs | 2 | ||||
| -rw-r--r-- | crates/parser/src/grammar/items.rs | 2 | ||||
| -rw-r--r-- | crates/parser/src/parser.rs | 2 | ||||
| -rw-r--r-- | crates/parser/src/shortcuts.rs | 6 |
4 files changed, 5 insertions, 7 deletions
diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs index a884d8b6ec8..e6fb9e9d335 100644 --- a/crates/parser/src/grammar/expressions.rs +++ b/crates/parser/src/grammar/expressions.rs @@ -417,7 +417,7 @@ fn postfix_expr( allow_calls = true; block_like = BlockLike::NotBlock; } - return (lhs, block_like); + (lhs, block_like) } fn postfix_dot_expr<const FLOAT_RECOVERY: bool>( diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs index 5e0951bf8b5..1c056819f4b 100644 --- a/crates/parser/src/grammar/items.rs +++ b/crates/parser/src/grammar/items.rs @@ -19,7 +19,7 @@ use super::*; // struct S; pub(super) fn mod_contents(p: &mut Parser<'_>, stop_on_r_curly: bool) { attributes::inner_attrs(p); - while !p.at(EOF) && !(p.at(T!['}']) && stop_on_r_curly) { + while !(p.at(EOF) || (p.at(T!['}']) && stop_on_r_curly)) { item_or_macro(p, stop_on_r_curly); } } diff --git a/crates/parser/src/parser.rs b/crates/parser/src/parser.rs index 280416ae7c9..ef413c63754 100644 --- a/crates/parser/src/parser.rs +++ b/crates/parser/src/parser.rs @@ -205,7 +205,7 @@ impl<'t> Parser<'t> { marker.bomb.defuse(); marker = new_marker; }; - self.pos += 1 as usize; + self.pos += 1; self.push_event(Event::FloatSplitHack { ends_in_dot }); (ends_in_dot, marker) } diff --git a/crates/parser/src/shortcuts.rs b/crates/parser/src/shortcuts.rs index 47e4adcbbe6..5cdb39700dd 100644 --- a/crates/parser/src/shortcuts.rs +++ b/crates/parser/src/shortcuts.rs @@ -46,10 +46,8 @@ impl<'a> LexedStr<'a> { // Tag the token as joint if it is float with a fractional part // we use this jointness to inform the parser about what token split // event to emit when we encounter a float literal in a field access - if kind == SyntaxKind::FLOAT_NUMBER { - if !self.text(i).ends_with('.') { - res.was_joint(); - } + if kind == SyntaxKind::FLOAT_NUMBER && !self.text(i).ends_with('.') { + res.was_joint(); } } |
