@@ -1312,7 +1312,7 @@ fn generate_variant_error_conversions(
1312
1312
}
1313
1313
1314
1314
/// Generate error conversion for a given enum variant.
1315
- fn parse_attr_and_gen_error_conversions < ' a > (
1315
+ fn parse_attr_and_gen_error_conversions (
1316
1316
attr : & syn:: Attribute ,
1317
1317
enum_name : & syn:: Ident ,
1318
1318
variant_name : & syn:: Ident ,
@@ -1322,24 +1322,21 @@ fn parse_attr_and_gen_error_conversions<'a>(
1322
1322
x. span ( ) ,
1323
1323
"The `from` attribute expects a list of error types, e.g.: #[from(ParseError)]." ,
1324
1324
) ;
1325
- vec ! [ err. to_compile_error( ) . into ( ) ]
1325
+ vec ! [ err. to_compile_error( ) ]
1326
1326
} ;
1327
1327
match attr. parse_meta ( ) {
1328
1328
Ok ( syn:: Meta :: List ( list) ) if list. path . is_ident ( "from" ) => {
1329
1329
let mut from_error_names = vec ! [ ] ;
1330
1330
for nested in list. nested . iter ( ) {
1331
- match nested {
1332
- syn:: NestedMeta :: Meta ( syn:: Meta :: Path ( from_error) ) => {
1333
- match from_error. get_ident ( ) {
1334
- Some ( ident) => {
1335
- from_error_names. push ( ident) ;
1336
- }
1337
- None => {
1338
- return wrong_from_usage ( from_error) ;
1339
- }
1331
+ if let syn:: NestedMeta :: Meta ( syn:: Meta :: Path ( from_error) ) = nested {
1332
+ match from_error. get_ident ( ) {
1333
+ Some ( ident) => {
1334
+ from_error_names. push ( ident) ;
1335
+ }
1336
+ None => {
1337
+ return wrong_from_usage ( from_error) ;
1340
1338
}
1341
1339
}
1342
- _ => ( ) ,
1343
1340
}
1344
1341
}
1345
1342
from_error_token_stream ( from_error_names, & enum_name, variant_name)
0 commit comments