use std::fmt::{Display, Formatter}; use std::path::{PathBuf}; use std::ffi::OsStr; #[derive(Debug)] pub struct GitFile(pub PathBuf); impl GitFile { pub(crate) fn new(fullname : PathBuf) -> GitFile { GitFile(fullname) } pub fn name(&self) -> Option<&OsStr> { self.0.file_name() } } impl Display for GitFile { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0.display()) } }