cargo_wsinit/
toml_file.rs

1use std::fmt::{Display, Formatter, Result as FmtResult};
2use std::ops::Deref;
3use std::path::PathBuf;
4
5#[derive(Clone, Debug)]
6pub struct TomlFile(PathBuf);
7
8impl TomlFile {
9    pub(crate) fn new(path: PathBuf) -> TomlFile {
10        TomlFile(path)
11    }
12}
13
14impl Deref for TomlFile {
15    type Target = PathBuf;
16
17    fn deref(&self) -> &Self::Target {
18        &self.0
19    }
20}
21
22impl Display for TomlFile {
23    fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
24        write!(f, "{}", self.to_str().unwrap())
25    }
26}