treeflow 0.2.1

CLI tool for simplified Git worktree management to speed up switching contexts when working collaboratively.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::path::PathBuf;
use crate::utils::errors::CustomError;

pub trait PathBufExtensions {
    fn to_str_result(&self) -> Result<&str, CustomError>;
}

impl PathBufExtensions for PathBuf {
    fn to_str_result(&self) -> Result<&str, CustomError> {
        self.to_str().ok_or(CustomError::Custom(self.display().to_string() + " was not a UTF-8 string."))
    }
}