From 3f06966076f0e3b68d3f7e87712aed855791b58f Mon Sep 17 00:00:00 2001 From: Ted Driggs Date: Mon, 15 May 2017 15:03:21 -0700 Subject: [PATCH] Cleanup generated code to avoid unreachable match arm --- core/src/codegen/fmi_impl.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/codegen/fmi_impl.rs b/core/src/codegen/fmi_impl.rs index 3571837..60ab0c9 100644 --- a/core/src/codegen/fmi_impl.rs +++ b/core/src/codegen/fmi_impl.rs @@ -61,8 +61,7 @@ impl<'a> ToTokens for FmiImpl<'a> { quote!( fn from_list(__outer: &[::syn::NestedMetaItem]) -> ::darling::Result { 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() { @@ -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)), } }