mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Simplify
This commit is contained in:
parent
809461cc42
commit
a0e0e4575b
4 changed files with 47 additions and 59 deletions
|
@ -1,11 +1,11 @@
|
|||
//! A "Parser" structure for token trees. We use this when parsing a declarative
|
||||
//! macro definition into a list of patterns and templates.
|
||||
|
||||
use crate::{to_parser_input::to_parser_input, ExpandError, ExpandResult};
|
||||
|
||||
use syntax::SyntaxKind;
|
||||
use tt::buffer::TokenBuffer;
|
||||
|
||||
use crate::{to_parser_input::to_parser_input, ExpandError, ExpandResult};
|
||||
|
||||
macro_rules! err {
|
||||
() => {
|
||||
ExpandError::BindingError(format!(""))
|
||||
|
@ -27,7 +27,7 @@ impl<'a> TtIter<'a> {
|
|||
|
||||
pub(crate) fn expect_char(&mut self, char: char) -> Result<(), ()> {
|
||||
match self.next() {
|
||||
Some(tt::TokenTree::Leaf(tt::Leaf::Punct(tt::Punct { char: c, .. }))) if *c == char => {
|
||||
Some(&tt::TokenTree::Leaf(tt::Leaf::Punct(tt::Punct { char: c, .. }))) if c == char => {
|
||||
Ok(())
|
||||
}
|
||||
_ => Err(()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue