diff --git a/src/task.rs b/src/task.rs index f62fcbe..e5381f8 100644 --- a/src/task.rs +++ b/src/task.rs @@ -193,6 +193,7 @@ pub fn run_v2() -> Result<(), Box> { Ok(()) } +#[allow(dead_code)] pub trait Validate { type Type: fmt::Debug + Default + 'static; type Error: fmt::Debug + ToString; diff --git a/src/task/cluster.rs b/src/task/cluster.rs index 1cd7403..db55eba 100644 --- a/src/task/cluster.rs +++ b/src/task/cluster.rs @@ -801,7 +801,7 @@ impl Cluster { .build()?; state.dump_by_uid(&state_dir)?; - state.dump_by_path(latest_path)?; + state.symlink_latest(latest_path)?; Ok(self) } diff --git a/src/task/cluster/fs.rs b/src/task/cluster/fs.rs index 47bb417..6afd9bd 100644 --- a/src/task/cluster/fs.rs +++ b/src/task/cluster/fs.rs @@ -69,6 +69,8 @@ impl FsInteraction { } } +#[allow(dead_code)] + pub trait TryIntoFile { type Error; @@ -126,6 +128,7 @@ impl<'a> From<&'a ArgMatches> for IO { } } +#[allow(dead_code)] pub trait TryMap { type Error; type Output; diff --git a/src/task/state.rs b/src/task/state.rs index 4ca12a1..7e58cf8 100644 --- a/src/task/state.rs +++ b/src/task/state.rs @@ -2,6 +2,7 @@ use std::{ fmt::Display, fs::{create_dir_all, remove_dir_all, File}, io::{self, Read, Write}, + os::unix::fs, path::PathBuf, }; @@ -112,6 +113,10 @@ impl State { self.dump_by_path(&format!("{state_dir}/{}.gz", &self.uid)) } + pub fn symlink_latest(&mut self, latest: &str) -> Result<(), io::Error> { + fs::symlink(&format!("{}.gz", &self.uid), latest) + } + pub fn from_latest(args: &ArgMatches) -> Result { let path = format!( "{}/latest.gz",