gitbox 2.1.3

Git toolbox to simplify adoption of conventional commits and semantic version, among other things.
Documentation
use std::{error::Error, fmt::Display};

#[derive(Debug)]
pub struct CommitOptionsInvariantError {
    what: String,
    message: String,
}

impl CommitOptionsInvariantError {
    pub fn new(what: &str, message: &str) -> CommitOptionsInvariantError {
        CommitOptionsInvariantError {
            what: what.to_string(),
            message: message.to_string(),
        }
    }
}

impl Display for CommitOptionsInvariantError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "Error while constructing commit options: {} {}",
            self.what, self.message
        )
    }
}

impl Error for CommitOptionsInvariantError {}