Skip to content

Commit

Permalink
address some lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Aug 25, 2024
1 parent 65c14e2 commit 5497f75
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions mavlink-bindgen/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand All @@ -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();
Expand Down

0 comments on commit 5497f75

Please sign in to comment.