]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/publish.rs
Deal with all lints
[rbdr/blog] / src / command / publish.rs
index 34ca0d28388fec1a414a1ba79b609aa6e26ffe68..388792ff54bcd736d447252910a20070b84160c5 100644 (file)
@@ -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>> {