Shrink ast::Attribute
.
This commit is contained in:
parent
40336865fe
commit
85a6cd6a47
15 changed files with 167 additions and 149 deletions
|
@ -212,7 +212,7 @@ impl HasTokens for Stmt {
|
|||
impl HasTokens for Attribute {
|
||||
fn tokens(&self) -> Option<&LazyTokenStream> {
|
||||
match &self.kind {
|
||||
AttrKind::Normal(_, tokens) => tokens.as_ref(),
|
||||
AttrKind::Normal(normal) => normal.tokens.as_ref(),
|
||||
kind @ AttrKind::DocComment(..) => {
|
||||
panic!("Called tokens on doc comment attr {:?}", kind)
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ impl HasTokens for Attribute {
|
|||
}
|
||||
fn tokens_mut(&mut self) -> Option<&mut Option<LazyTokenStream>> {
|
||||
Some(match &mut self.kind {
|
||||
AttrKind::Normal(_, tokens) => tokens,
|
||||
AttrKind::Normal(normal) => &mut normal.tokens,
|
||||
kind @ AttrKind::DocComment(..) => {
|
||||
panic!("Called tokens_mut on doc comment attr {:?}", kind)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue