Lines
0 %
Functions
Branches
100 %
use std::fmt;
/// Error type for cdup operations
#[derive(Debug)]
pub enum Error {
/// Current working directory could not be determined
InvalidCwd(std::io::Error),
/// No fuzzy match found for the target
NoMatch,
/// Shell could not be detected
ShellNotDetected,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::InvalidCwd(_) => write!(f, "Could not get current working directory"),
Error::NoMatch => write!(f, "No match found for target."),
Error::ShellNotDetected => {
write!(f, "No hint given and SHELL environment variable not found.")
impl std::error::Error for Error {}