Skip to content

Commit

Permalink
use 'assert'
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel.eades authored and patrickelectric committed Mar 19, 2023
1 parent c8349f3 commit 6dfd5f7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions build/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ impl MavProfile {
fn add_message(&mut self, message: &MavMessage) {
match self.messages.entry(message.name.clone()) {
Entry::Occupied(entry) => {
if entry.get() != message {
panic!(
"Message '{}' defined twice but definitions are different",
message.name
);
}
assert!(
entry.get() == message,
"Message '{}' defined twice but definitions are different",
message.name
);
}
Entry::Vacant(entry) => {
entry.insert(message.clone());
Expand Down

0 comments on commit 6dfd5f7

Please sign in to comment.