diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-14 11:24:46 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-18 13:25:17 +1100 |
| commit | 212ae58f36e4c9f2e0f46153f1c50a657e6c25db (patch) | |
| tree | 1927b7b4abb875e020d6b8ab4a8356285049fdda /src/libsyntax/attr | |
| parent | a6eef299d3b0ca24f8ffc0c3dc03283c09ec7945 (diff) | |
| download | rust-212ae58f36e4c9f2e0f46153f1c50a657e6c25db.tar.gz rust-212ae58f36e4c9f2e0f46153f1c50a657e6c25db.zip | |
Change `Lit::tokens()` to `Lit::token_tree()`.
Because most of the call sites have an easier time working with a `TokenTree` instead of a `TokenStream`.
Diffstat (limited to 'src/libsyntax/attr')
| -rw-r--r-- | src/libsyntax/attr/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index 402c2cad72f..8786c850bfd 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -541,9 +541,10 @@ impl MetaItemKind { match *self { MetaItemKind::Word => TokenStream::default(), MetaItemKind::NameValue(ref lit) => { - let mut vec = vec![TokenTree::token(token::Eq, span).into()]; - lit.tokens().append_to_tree_and_joint_vec(&mut vec); - TokenStream::new(vec) + TokenStream::new(vec![ + TokenTree::token(token::Eq, span).into(), + lit.token_tree().into(), + ]) } MetaItemKind::List(ref list) => { let mut tokens = Vec::new(); @@ -606,7 +607,7 @@ impl NestedMetaItem { fn tokens(&self) -> TokenStream { match *self { NestedMetaItem::MetaItem(ref item) => item.tokens(), - NestedMetaItem::Literal(ref lit) => lit.tokens(), + NestedMetaItem::Literal(ref lit) => lit.token_tree().into(), } } |
