Skip to content

Commit

Permalink
Cleanup generated code to avoid unreachable match arm
Browse files Browse the repository at this point in the history
  • Loading branch information
TedDriggs committed May 15, 2017
1 parent 6e58b23 commit 3f06966
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/codegen/fmi_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ impl<'a> ToTokens for FmiImpl<'a> {
quote!(
fn from_list(__outer: &[::syn::NestedMetaItem]) -> ::darling::Result<Self> {
match __outer.len() {
__x if __x < 1 => ::darling::export::Err(::darling::Error::too_few_items(1)),
__x if __x > 1 => ::darling::export::Err(::darling::Error::too_many_items(1)),
0 => ::darling::export::Err(::darling::Error::too_few_items(1)),
1 => {
if let ::syn::NestedMetaItem::MetaItem(ref __nested) = __outer[0] {
match __nested.name() {
Expand All @@ -73,7 +72,7 @@ impl<'a> ToTokens for FmiImpl<'a> {
::darling::export::Err(::darling::Error::unsupported_format("literal"))
}
}
_ => unreachable!()
_ => ::darling::export::Err(::darling::Error::too_many_items(1)),
}
}

Expand Down

0 comments on commit 3f06966

Please sign in to comment.