iocaine 2.2.0

The deadliest poison known to AI
Documentation
// SPDX-FileCopyrightText: 2025 Gergely Nagy
// SPDX-FileContributor: Gergely Nagy
//
// SPDX-License-Identifier: MIT

use roto::RotoReport;
use std::fmt;

#[derive(Debug)]
pub enum Error {
    Report(RotoReport),
    String(String),
}

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

impl fmt::Display for Error {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::Report(r) => write!(f, "{r}"),
            Self::String(s) => write!(f, "{s}"),
        }
    }
}

impl From<RotoReport> for Error {
    fn from(r: RotoReport) -> Self {
        Self::Report(r)
    }
}

impl From<String> for Error {
    fn from(s: String) -> Self {
        Self::String(s)
    }
}