diff --git a/mavlink-bindgen/src/parser.rs b/mavlink-bindgen/src/parser.rs index 1ff3aa0f81..e596f50d8b 100644 --- a/mavlink-bindgen/src/parser.rs +++ b/mavlink-bindgen/src/parser.rs @@ -1094,14 +1094,11 @@ pub fn parse_profile( for e in events { match e { Ok(Event::Start(bytes)) => { - let id = match identify_element(bytes.name().into_inner()) { - None => { - panic!( - "unexpected element {:?}", - String::from_utf8_lossy(bytes.name().into_inner()) - ); - } - Some(kind) => kind, + let Some(id) = identify_element(bytes.name().into_inner()) else { + panic!( + "unexpected element {:?}", + String::from_utf8_lossy(bytes.name().into_inner()) + ); }; assert!( @@ -1116,14 +1113,14 @@ pub fn parse_profile( is_in_extension = true; } MavXmlElement::Message => { - message = Default::default(); + message = MavMessage::default(); } MavXmlElement::Field => { - field = Default::default(); + field = MavField::default(); field.is_extension = is_in_extension; } MavXmlElement::Enum => { - mavenum = Default::default(); + mavenum = MavEnum::default(); } MavXmlElement::Entry => { entry = MavEnumEntry::default();