#[derive(Debug)]
#[non_exhaustive]
pub enum Error {}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "impossible error")
}
}
impl std::error::Error for Error {}
#[cfg(test)]
mod tests {
use super::*;
fn returns_error() -> Result<(), Error> {
Ok(())
}
fn returns_anyhow_error() -> Result<(), anyhow::Error> {
returns_error()?;
Ok(())
}
#[test]
fn test_error() {
returns_anyhow_error().unwrap();
}
}