aboutsummaryrefslogtreecommitdiff
path: root/src/command/publish_archive.rs
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-01-05 00:38:55 +0100
committerRuben Beltran del Rio <git@r.bdr.sh>2025-01-05 00:38:55 +0100
commitd7fef30ac3f539975ef9edbba8e0af4a4e9ff3de (patch)
tree1e71dd131261a8f7a13d86d4dddd7d421e6a09f4 /src/command/publish_archive.rs
parentd26464d12e41e8d53fca8d0e5f9cc6ac03e48f9a (diff)
Commit batch of lints to allow autofix
Diffstat (limited to 'src/command/publish_archive.rs')
-rw-r--r--src/command/publish_archive.rs23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/command/publish_archive.rs b/src/command/publish_archive.rs
index c727c16..96dda86 100644
--- a/src/command/publish_archive.rs
+++ b/src/command/publish_archive.rs
@@ -1,5 +1,5 @@
-use std::io::{Error, ErrorKind::Other, Result};
use crate::configuration::Configuration;
+use std::io::{Error, ErrorKind::Other, Result};
use std::process::{Command, Stdio};
const COMMAND: &str = "rsync";
@@ -17,10 +17,15 @@ impl super::Command for PublishArchive {
vec![]
}
- fn execute(&self, input: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> {
-
- let input = input
- .ok_or_else(|| Error::new(Other, "You must provide a location to publish the archive"))?;
+ fn execute(
+ &self,
+ input: Option<&String>,
+ configuration: &Configuration,
+ _: &str,
+ ) -> Result<()> {
+ let input = input.ok_or_else(|| {
+ Error::new(Other, "You must provide a location to publish the archive")
+ })?;
Command::new(COMMAND)
.arg("--version")
@@ -29,16 +34,18 @@ impl super::Command for PublishArchive {
.status()
.map_err(|_| Error::new(Other, "Publishing requires rsync"))?;
-
Command::new(COMMAND)
.arg("-r")
- .arg(format!("{}/", &configuration.archive_output_directory.display()))
+ .arg(format!(
+ "{}/",
+ &configuration.archive_output_directory.display()
+ ))
.arg(input.as_str())
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.map_err(|_| Error::new(Other, "Rsync failed to publish."))?;
- return Ok(())
+ Ok(())
}
fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {