use alloc::boxed::Box;
use core::fmt::{self, Debug, Display};

/// Exception thrown from an `extern "C++"` function.
#[derive(Debug)]
pub struct Exception {
    pub(crate) what: Box<str>,
}

impl Display for Exception {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str(&self.what)
    }
}

impl std::error::Error for Exception {}

impl Exception {
    pub fn what(&self) -> &str {
        &self.what
    }
}

use alloc::boxed::Box;
use core::fmt::{self, Display};

/// Exception thrown from an `extern "C++"` function.
#[derive(Debug)]
pub struct Exception {
    pub(crate) what: Box<str>,
}

impl Display for Exception {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str(&self.what)
    }
}

impl std::error::Error for Exception {}

impl Exception {
    pub fn what(&self) -> &str {
        &self.what
    }
}

Clean up unneeded Debug derive macro import
Clean up unneeded Debug derive macro import

Presumably this used to be a handwritten Debug impl which needed the
import, later replaced by #[derive(Debug)] which is present in the
prelude but masks the unused_imports warning.
