@@ -27,6 +27,7 @@ pub struct Data<'a> {
27
27
pub path : Path ,
28
28
/// [Type](DataType) of this struct, union or variant.
29
29
pub type_ : DataType < ' a > ,
30
+ #[ cfg_attr( feature = "nightly" , allow( unused) ) ]
30
31
/// Discriminant of this variant.
31
32
pub discriminant : Option < & ' a Expr > ,
32
33
}
@@ -69,7 +70,7 @@ pub enum SimpleType<'a> {
69
70
/// Tuple struct or tuple variant.
70
71
Tuple ( & ' a Fields < ' a > ) ,
71
72
/// Union.
72
- Union ( & ' a Fields < ' a > ) ,
73
+ Union ( # [ allow ( unused ) ] & ' a Fields < ' a > ) ,
73
74
/// Unit variant.
74
75
Unit ( & ' a Pat ) ,
75
76
}
@@ -332,10 +333,7 @@ impl<'a> Data<'a> {
332
333
}
333
334
334
335
/// Returns an [`Iterator`] over [`Field`]s.
335
- pub fn iter_fields (
336
- & self ,
337
- trait_ : Trait ,
338
- ) -> impl ' _ + Iterator < Item = & ' _ Field > + DoubleEndedIterator {
336
+ pub fn iter_fields ( & self , trait_ : Trait ) -> impl ' _ + DoubleEndedIterator < Item = & ' _ Field > {
339
337
if self . skip ( trait_) {
340
338
[ ] . iter ( )
341
339
} else {
@@ -354,19 +352,13 @@ impl<'a> Data<'a> {
354
352
355
353
/// Returns an [`Iterator`] over [`struct@Ident`]s used as temporary
356
354
/// variables for destructuring `self`.
357
- pub fn iter_self_ident (
358
- & self ,
359
- trait_ : Trait ,
360
- ) -> impl Iterator < Item = & ' _ Ident > + DoubleEndedIterator {
355
+ pub fn iter_self_ident ( & self , trait_ : Trait ) -> impl DoubleEndedIterator < Item = & ' _ Ident > {
361
356
self . iter_fields ( trait_) . map ( |field| & field. self_ident )
362
357
}
363
358
364
359
/// Returns an [`Iterator`] over [`struct@Ident`]s used as temporary
365
360
/// variables for destructuring `other`.
366
- pub fn iter_other_ident (
367
- & self ,
368
- trait_ : Trait ,
369
- ) -> impl Iterator < Item = & ' _ Ident > + DoubleEndedIterator {
361
+ pub fn iter_other_ident ( & self , trait_ : Trait ) -> impl DoubleEndedIterator < Item = & ' _ Ident > {
370
362
self . iter_fields ( trait_) . map ( |field| & field. other_ident )
371
363
}
372
364
}
0 commit comments