diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-05 00:38:55 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-05 00:38:55 +0100 |
| commit | d7fef30ac3f539975ef9edbba8e0af4a4e9ff3de (patch) | |
| tree | 1e71dd131261a8f7a13d86d4dddd7d421e6a09f4 /src/command/publish.rs | |
| parent | d26464d12e41e8d53fca8d0e5f9cc6ac03e48f9a (diff) | |
Commit batch of lints to allow autofix
Diffstat (limited to 'src/command/publish.rs')
| -rw-r--r-- | src/command/publish.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/command/publish.rs b/src/command/publish.rs index 34ca0d2..388792f 100644 --- a/src/command/publish.rs +++ b/src/command/publish.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,8 +17,12 @@ impl super::Command for Publish { vec![] } - fn execute(&self, input: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> { - + 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 blog"))?; @@ -29,16 +33,18 @@ impl super::Command for Publish { .status() .map_err(|_| Error::new(Other, "Publishing requires rsync"))?; - Command::new(COMMAND) .arg("-r") - .arg(format!("{}/", &configuration.blog_output_directory.display())) + .arg(format!( + "{}/", + &configuration.blog_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>> { |