From 5497f758cb62ec072c0f632e37bcf98770480114 Mon Sep 17 00:00:00 2001 From: Daniel Eades Date: Sun, 25 Aug 2024 07:30:08 +0100 Subject: [PATCH] address some lint warnings --- mavlink-bindgen/src/parser.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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();