Skip to content

Commit 56c6d97

Browse files
committed
chore: clean up path types.
1 parent 0871f67 commit 56c6d97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

migration/util/migrator-types/src/migrator/movement_migrator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use mtma_types::movement::movement_client::rest_client::Client as MovementRestCl
88
pub mod live;
99
pub use live::LiveMigrator;
1010
use mtma_util::file::copy_dir_recursive;
11-
use std::path::PathBuf;
11+
use std::path::{Path, PathBuf};
1212
use tracing::warn;
1313

1414
/// An enum supporting different types of runners.
@@ -126,17 +126,17 @@ impl MovementMigrator {
126126
}
127127

128128
/// Recursively copies the dir for the runner to the given path
129-
pub async fn copy_dir(&self, path: PathBuf) -> Result<(), anyhow::Error> {
129+
pub async fn copy_dir(&self, path: &Path) -> Result<(), anyhow::Error> {
130130
let dir = self.dir();
131-
copy_dir_recursive(&dir, &path).context("failed to copy dir for MovementMigrator")?;
131+
copy_dir_recursive(&dir, path).context("failed to copy dir for MovementMigrator")?;
132132
Ok(())
133133
}
134134

135135
/// Snapshots the migrator
136136
///
137137
/// NOTE: this can be used to, for example, transition from a live migrator to a movement runner.
138138
pub async fn snapshot(&self, path: PathBuf) -> Result<Self, anyhow::Error> {
139-
self.copy_dir(path.clone()).await?;
139+
self.copy_dir(&path).await?;
140140

141141
Ok(Self::new(Runner::Movement(Movement::try_from_dot_movement_dir(path)?)))
142142
}

0 commit comments

Comments
 (0)