From 19d052a3d3d279cb8fb6427a5bcaf44493e420fd Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Tue, 1 Dec 2020 08:59:59 +0200 Subject: [PATCH] Avoid having an Rc to a PathBuf --- src/main.rs | 2 +- src/steps/remote/vagrant.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index e6007f8b..e3fb0f83 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -#![allow(clippy::cognitive_complexity, clippy::clippy::rc_buffer)] +#![allow(clippy::cognitive_complexity)] mod config; mod ctrlc; mod error; diff --git a/src/steps/remote/vagrant.rs b/src/steps/remote/vagrant.rs index 051f84d9..c0b8a605 100644 --- a/src/steps/remote/vagrant.rs +++ b/src/steps/remote/vagrant.rs @@ -26,7 +26,7 @@ impl BoxStatus { #[derive(Debug)] pub struct VagrantBox { - path: Rc, + path: Rc, name: String, initial_status: BoxStatus, } @@ -53,7 +53,7 @@ struct Vagrant { impl Vagrant { fn get_boxes<'a>(&self, directory: &'a str) -> Result> { - let path = Rc::new(PathBuf::from(directory)); + let path: Rc = Path::new(directory).into(); let output = Command::new(&self.path) .arg("status") @@ -111,7 +111,7 @@ impl<'a> TemporaryPowerOn<'a> { ctx.run_type() .execute(vagrant) .args(&[subcommand, &vagrant_box.name]) - .current_dir(vagrant_box.path.as_path()) + .current_dir(vagrant_box.path.clone()) .check_run()?; Ok(TemporaryPowerOn { vagrant, @@ -138,7 +138,7 @@ impl<'a> Drop for TemporaryPowerOn<'a> { .run_type() .execute(self.vagrant) .args(&[subcommand, &self.vagrant_box.name]) - .current_dir(self.vagrant_box.path.as_path()) + .current_dir(self.vagrant_box.path.clone()) .check_run() .ok(); } @@ -194,7 +194,7 @@ pub fn topgrade_vagrant_box(ctx: &ExecutionContext, vagrant_box: &VagrantBox) -> ctx.run_type() .execute(&vagrant.path) - .current_dir(&vagrant_box.path.as_path()) + .current_dir(&vagrant_box.path) .args(&["ssh", "-c", &command]) .check_run() }