@@ -250,14 +250,14 @@ macro_rules! count_ident{
250
250
}
251
251
252
252
macro_rules! impl_tuple_collect {
253
- ( $A : ident ; $ ( $X: ident) ,* ; $( $Y: ident) ,* ; $( $Y_rev: ident) ,* ) => (
254
- impl <$ A> TupleCollect for ( $( $X) ,* , ) {
255
- type Item = $ A;
256
- type Buffer = [ Option <$ A>; count_ident!( $( $Y, ) * ) - 1 ] ;
253
+ ( $( $X: ident) ,* ; $( $Y: ident) ,* ; $( $Y_rev: ident) ,* ) => (
254
+ impl <A > TupleCollect for ( $( $X) ,* , ) {
255
+ type Item = A ;
256
+ type Buffer = [ Option <A >; count_ident!( $( $Y, ) * ) - 1 ] ;
257
257
258
258
#[ allow( unused_assignments, unused_mut) ]
259
259
fn collect_from_iter<I >( iter: I , buf: & mut Self :: Buffer ) -> Option <Self >
260
- where I : IntoIterator <Item = $ A>
260
+ where I : IntoIterator <Item = A >
261
261
{
262
262
let mut iter = iter. into_iter( ) ;
263
263
$(
@@ -286,7 +286,7 @@ macro_rules! impl_tuple_collect {
286
286
}
287
287
288
288
fn collect_from_iter_no_buf<I >( iter: I ) -> Option <Self >
289
- where I : IntoIterator <Item = $ A>
289
+ where I : IntoIterator <Item = A >
290
290
{
291
291
let mut iter = iter. into_iter( ) ;
292
292
@@ -299,7 +299,7 @@ macro_rules! impl_tuple_collect {
299
299
count_ident!( $( $Y, ) * )
300
300
}
301
301
302
- fn left_shift_push( & mut self , item: $ A) {
302
+ fn left_shift_push( & mut self , item: A ) {
303
303
use std:: mem:: replace;
304
304
305
305
let & mut ( $( ref mut $Y) ,* , ) = self ;
@@ -317,22 +317,22 @@ macro_rules! impl_tuple_collect {
317
317
// use itertools::Itertools;
318
318
//
319
319
// for i in 1..=12 {
320
- // println!("impl_tuple_collect!(A; {ty}; {idents}; {rev_idents});",
320
+ // println!("impl_tuple_collect!({ty}; {idents}; {rev_idents});",
321
321
// ty=iter::repeat("A").take(i).join(", "),
322
322
// idents=('a'..='z').take(i).join(", "),
323
323
// rev_idents=('a'..='z').take(i).collect_vec().into_iter().rev().join(", ")
324
324
// );
325
325
// }
326
326
// It could probably be replaced by a bit more macro cleverness.
327
- impl_tuple_collect ! ( A ; A ; a; a) ;
328
- impl_tuple_collect ! ( A ; A , A ; a, b; b, a) ;
329
- impl_tuple_collect ! ( A ; A , A , A ; a, b, c; c, b, a) ;
330
- impl_tuple_collect ! ( A ; A , A , A , A ; a, b, c, d; d, c, b, a) ;
331
- impl_tuple_collect ! ( A ; A , A , A , A , A ; a, b, c, d, e; e, d, c, b, a) ;
332
- impl_tuple_collect ! ( A ; A , A , A , A , A , A ; a, b, c, d, e, f; f, e, d, c, b, a) ;
333
- impl_tuple_collect ! ( A ; A , A , A , A , A , A , A ; a, b, c, d, e, f, g; g, f, e, d, c, b, a) ;
334
- impl_tuple_collect ! ( A ; A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h; h, g, f, e, d, c, b, a) ;
335
- impl_tuple_collect ! ( A ; A , A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h, i; i, h, g, f, e, d, c, b, a) ;
336
- impl_tuple_collect ! ( A ; A , A , A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h, i, j; j, i, h, g, f, e, d, c, b, a) ;
337
- impl_tuple_collect ! ( A ; A , A , A , A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h, i, j, k; k, j, i, h, g, f, e, d, c, b, a) ;
338
- impl_tuple_collect ! ( A ; A , A , A , A , A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h, i, j, k, l; l, k, j, i, h, g, f, e, d, c, b, a) ;
327
+ impl_tuple_collect ! ( A ; a; a) ;
328
+ impl_tuple_collect ! ( A , A ; a, b; b, a) ;
329
+ impl_tuple_collect ! ( A , A , A ; a, b, c; c, b, a) ;
330
+ impl_tuple_collect ! ( A , A , A , A ; a, b, c, d; d, c, b, a) ;
331
+ impl_tuple_collect ! ( A , A , A , A , A ; a, b, c, d, e; e, d, c, b, a) ;
332
+ impl_tuple_collect ! ( A , A , A , A , A , A ; a, b, c, d, e, f; f, e, d, c, b, a) ;
333
+ impl_tuple_collect ! ( A , A , A , A , A , A , A ; a, b, c, d, e, f, g; g, f, e, d, c, b, a) ;
334
+ impl_tuple_collect ! ( A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h; h, g, f, e, d, c, b, a) ;
335
+ impl_tuple_collect ! ( A , A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h, i; i, h, g, f, e, d, c, b, a) ;
336
+ impl_tuple_collect ! ( A , A , A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h, i, j; j, i, h, g, f, e, d, c, b, a) ;
337
+ impl_tuple_collect ! ( A , A , A , A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h, i, j, k; k, j, i, h, g, f, e, d, c, b, a) ;
338
+ impl_tuple_collect ! ( A , A , A , A , A , A , A , A , A , A , A , A ; a, b, c, d, e, f, g, h, i, j, k, l; l, k, j, i, h, g, f, e, d, c, b, a) ;
0 commit comments