Skip to content

Commit cad83be

Browse files
committed
Minor changes.
1 parent 6753c7b commit cad83be

File tree

1 file changed

+9
-12
lines changed
  • concordium-std-derive/src

1 file changed

+9
-12
lines changed

concordium-std-derive/src/lib.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ fn generate_variant_error_conversions(
13121312
}
13131313

13141314
/// 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(
13161316
attr: &syn::Attribute,
13171317
enum_name: &syn::Ident,
13181318
variant_name: &syn::Ident,
@@ -1322,24 +1322,21 @@ fn parse_attr_and_gen_error_conversions<'a>(
13221322
x.span(),
13231323
"The `from` attribute expects a list of error types, e.g.: #[from(ParseError)].",
13241324
);
1325-
vec![err.to_compile_error().into()]
1325+
vec![err.to_compile_error()]
13261326
};
13271327
match attr.parse_meta() {
13281328
Ok(syn::Meta::List(list)) if list.path.is_ident("from") => {
13291329
let mut from_error_names = vec![];
13301330
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);
13401338
}
13411339
}
1342-
_ => (),
13431340
}
13441341
}
13451342
from_error_token_stream(from_error_names, &enum_name, variant_name)

0 commit comments

Comments
 (0)