Conversation
warning: this could be rewritten as `let...else`
--> src/parse.rs:183:9
|
183 | / let first = match input.bytes().next() {
184 | | Some(first) => first,
185 | | None => match stack.last() {
186 | | None => return Ok(trees.build()),
... |
195 | | },
196 | | };
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
= note: `-W clippy::manual-let-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_let_else)]`
help: consider writing
|
183 ~ let Some(first) = input.bytes().next() else { match stack.last() {
184 + None => return Ok(trees.build()),
185 + #[cfg(span_locations)]
186 + Some((lo, _frame)) => {
187 + return Err(LexError {
188 + span: Span { lo: *lo, hi: *lo },
189 + })
190 + }
191 + #[cfg(not(span_locations))]
192 + Some(_frame) => return Err(LexError { span: Span {} }),
193 + } };
|
warning: this could be rewritten as `let...else`
--> src/parse.rs:216:13
|
216 | / let frame = match stack.pop() {
217 | | Some(frame) => frame,
218 | | None => return Err(lex_error(input)),
219 | | };
| |______________^ help: consider writing: `let Some(frame) = stack.pop() else { return Err(lex_error(input)) };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
warning: this could be rewritten as `let...else`
--> src/parse.rs:898:5
|
898 | / let first = match chars.next() {
899 | | Some(ch) => ch,
900 | | None => {
901 | | return Err(Reject);
902 | | }
903 | | };
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
help: consider writing
|
898 ~ let Some(first) = chars.next() else {
899 + return Err(Reject);
900 + };
|
warning: this could be rewritten as `let...else`
--> tests/test.rs:787:5
|
787 | / let punct = match stream.into_iter().next().unwrap() {
788 | | TokenTree::Punct(punct) => punct,
789 | | _ => unreachable!(),
790 | | };
| |______^ help: consider writing: `let TokenTree::Punct(punct) = stream.into_iter().next().unwrap() else { unreachable!() };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
= note: `-W clippy::manual-let-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_let_else)]`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This version has Cargo's sparse protocol which greatly speeds up CI.