algoxcc 0.1.2

A solver for an exact cover with colors problem
Documentation
use std::{error::Error, fmt};

/// Parameter error messages for invalid parameters used in problem setup
#[derive(Debug, Eq, PartialEq, Clone, PartialOrd, Ord, Hash, Default)]
pub struct ParamError {
    pub message: String,
}

impl ParamError {
    pub fn new(message: String) -> Self {
        Self { message }
    }
}

impl Error for ParamError {}

impl fmt::Display for ParamError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "Parameter error: {}", &self.message)
    }
}