diff options
Diffstat (limited to 'zone_zfs/src')
-rw-r--r-- | zone_zfs/src/snapshot.rs | 2 | ||||
-rw-r--r-- | zone_zfs/src/zfs.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/zone_zfs/src/snapshot.rs b/zone_zfs/src/snapshot.rs index 402b3b9..84db4e3 100644 --- a/zone_zfs/src/snapshot.rs +++ b/zone_zfs/src/snapshot.rs @@ -30,7 +30,7 @@ impl TryFrom<&str> for Snapshot { } impl Snapshot { - pub fn clone_new(&self, path: PathBuf) -> Result<FileSystem> { + pub fn clone_new(&self, path: String) -> Result<FileSystem> { FileSystem::builder() .dataset(&self.dataset.join(path)) .build_from(self.to_owned()) diff --git a/zone_zfs/src/zfs.rs b/zone_zfs/src/zfs.rs index 70dc98a..0eaa4eb 100644 --- a/zone_zfs/src/zfs.rs +++ b/zone_zfs/src/zfs.rs @@ -21,11 +21,12 @@ impl ZFS { } #[cfg(feature = "chrono")] - pub fn clone_from_latest(&self, name: PathBuf, parent: PathBuf) -> Result<FileSystem> { + pub fn clone_latest(&self, name: String, parent: PathBuf) -> Result<PathBuf> { self.get_file_system(parent)? .get_latest_snapshot()? .ok_or_else(|| Error::Snapshot("No snapshot found".into()))? .clone_new(name) + .map(|fs| fs.mountpoint().into()) } pub fn get_file_systems(&self) -> Result<Vec<FileSystem>> { |