Skip to content

Commit

Permalink
Clean up by using CommentedTree type alias where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchmindtree committed Jun 27, 2022
1 parent 8ce781a commit 76df702
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sway-parse/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1055,10 +1055,10 @@ impl CommentedTokenTree {
Self::Tree(commented_tt) => commented_tt,
};
let tt = match commented_tt {
GenericTokenTree::Punct(punct) => punct.into(),
GenericTokenTree::Ident(ident) => ident.into(),
GenericTokenTree::Group(group) => group.strip_comments().into(),
GenericTokenTree::Literal(lit) => lit.into(),
CommentedTree::Punct(punct) => punct.into(),
CommentedTree::Ident(ident) => ident.into(),
CommentedTree::Group(group) => group.strip_comments().into(),
CommentedTree::Literal(lit) => lit.into(),
};
Some(tt)
}
Expand Down Expand Up @@ -1090,7 +1090,7 @@ impl Spanned for CommentedTokenStream {

#[cfg(test)]
mod tests {
use super::{lex_commented, CommentedTokenTree, GenericTokenTree};
use super::{lex_commented, CommentedTokenTree, CommentedTree};
use crate::priv_prelude::*;
use std::sync::Arc;

Expand Down Expand Up @@ -1118,7 +1118,7 @@ mod tests {
assert_eq!(tts.next().unwrap().span().as_str(), "Foo");
{
let group = match tts.next() {
Some(CommentedTokenTree::Tree(GenericTokenTree::Group(group))) => group,
Some(CommentedTokenTree::Tree(CommentedTree::Group(group))) => group,
_ => panic!("expected group"),
};
let mut tts = group.token_stream.token_trees().iter();
Expand Down

0 comments on commit 76df702

Please sign in to comment.