Improve the TokenStream
quoter.
This commit is contained in:
parent
d9cf601ae8
commit
ce616a7d6a
8 changed files with 76 additions and 58 deletions
|
@ -162,6 +162,12 @@ impl From<TokenTree> for TokenStream {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<Token> for TokenStream {
|
||||
fn from(token: Token) -> TokenStream {
|
||||
TokenTree::Token(DUMMY_SP, token).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Into<TokenStream>> iter::FromIterator<T> for TokenStream {
|
||||
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
|
||||
TokenStream::concat(iter.into_iter().map(Into::into).collect::<Vec<_>>())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue