From 6dfd5f7ab580ef0e640358963aedf5de4a4a5259 Mon Sep 17 00:00:00 2001 From: "daniel.eades" Date: Thu, 16 Feb 2023 11:28:11 +0000 Subject: [PATCH] use 'assert' --- build/parser.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/build/parser.rs b/build/parser.rs index 77dcf9ede2..94415d60a9 100644 --- a/build/parser.rs +++ b/build/parser.rs @@ -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());