From b506a374a0ba418734692c066d01ef6969b4a732 Mon Sep 17 00:00:00 2001 From: Matt Johnston <matt@ucc.asn.au> Date: Sat, 12 Nov 2022 18:27:56 +0800 Subject: [PATCH] Remove Error::OtherBug --- src/channel.rs | 2 +- src/error.rs | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/channel.rs b/src/channel.rs index 60fc9a4..ed68aa3 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -124,7 +124,7 @@ impl Channels { fn remove(&mut self, num: u32) -> Result<()> { // TODO any checks? *self.ch.get_mut(num as usize).ok_or(Error::BadChannel)? = None; - Err(Error::otherbug()) + todo!(); // Ok(()) } diff --git a/src/error.rs b/src/error.rs index 450b146..18431ba 100644 --- a/src/error.rs +++ b/src/error.rs @@ -95,9 +95,6 @@ pub enum Error { // Bug { location: snafu::Location }, /// Program bug Bug, - - // TODO remove this - OtherBug { location: snafu::Location }, } impl Error { @@ -126,24 +123,6 @@ impl Error { } } - pub fn otherbug() -> Error { - // Easier to track the source of errors in development, - // but release builds shouldn't panic. - if cfg!(debug_assertions) { - panic!("Hit a bug"); - } else { - let caller = core::panic::Location::caller(); - Error::OtherBug - { - location: snafu::Location::new( - caller.file(), - caller.line(), - caller.column(), - ), - } - } - } - /// Like [`bug()`] but with a message /// The message can be used instead of a code comment, is logged at `debug` level. #[cold] -- GitLab