use typed_fields::path;
path!(
WorkingDirectory
);
impl From<std::path::PathBuf> for WorkingDirectory {
fn from(path: std::path::PathBuf) -> Self {
Self::new(path)
}
}
#[cfg(test)]
mod tests {
#![allow(clippy::missing_panics_doc)]
use super::*;
#[test]
fn from_path_buf_keeps_the_path() {
let directory = WorkingDirectory::from(std::path::PathBuf::from("crates/example"));
assert_eq!(directory.get(), std::path::Path::new("crates/example"));
}
}