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."))
}
}