cargo-kit 0.1.10

Cargo subcommand to apply performance, compile-time, or size-optimized profiles and configs to your Rust project for enhanced build efficiency.
Documentation
use inquire::InquireError;

#[derive(thiserror::Error, Debug)]
pub enum DialogError {
    #[error("The dialog was interupted")]
    Interrupted,
    #[error("A generic error has occurred")]
    Generic(#[from] anyhow::Error),
}

pub type PromptResult<T> = Result<T, DialogError>;

impl From<InquireError> for DialogError {
    fn from(value: InquireError) -> Self {
        match value {
            InquireError::OperationInterrupted => Self::Interrupted,
            InquireError::OperationCanceled => Self::Interrupted,
            error => Self::Generic(error.into()),
        }
    }
}