File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,31 @@ impl Extend<TokenStream> for TokenStream {
304304 }
305305}
306306
307+ impl Extend < Group > for TokenStream {
308+ fn extend < I : IntoIterator < Item = Group > > ( & mut self , tokens : I ) {
309+ self . inner . extend ( tokens. into_iter ( ) . map ( TokenTree :: Group ) ) ;
310+ }
311+ }
312+
313+ impl Extend < Ident > for TokenStream {
314+ fn extend < I : IntoIterator < Item = Ident > > ( & mut self , tokens : I ) {
315+ self . inner . extend ( tokens. into_iter ( ) . map ( TokenTree :: Ident ) ) ;
316+ }
317+ }
318+
319+ impl Extend < Punct > for TokenStream {
320+ fn extend < I : IntoIterator < Item = Punct > > ( & mut self , tokens : I ) {
321+ self . inner . extend ( tokens. into_iter ( ) . map ( TokenTree :: Punct ) ) ;
322+ }
323+ }
324+
325+ impl Extend < Literal > for TokenStream {
326+ fn extend < I : IntoIterator < Item = Literal > > ( & mut self , tokens : I ) {
327+ self . inner
328+ . extend ( tokens. into_iter ( ) . map ( TokenTree :: Literal ) ) ;
329+ }
330+ }
331+
307332/// Collects a number of token trees into a single stream.
308333impl FromIterator < TokenTree > for TokenStream {
309334 fn from_iter < I : IntoIterator < Item = TokenTree > > ( tokens : I ) -> Self {
You can’t perform that action at this time.
0 commit comments