From d7fef30ac3f539975ef9edbba8e0af4a4e9ff3de Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sun, 5 Jan 2025 00:38:55 +0100 Subject: Commit batch of lints to allow autofix --- src/command/add.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/command/add.rs') diff --git a/src/command/add.rs b/src/command/add.rs index 02da0fb..d38d077 100644 --- a/src/command/add.rs +++ b/src/command/add.rs @@ -1,12 +1,7 @@ +use super::{generate::Generate, sync_down::SyncDown, sync_up::SyncUp, update::Update}; +use crate::configuration::Configuration; use std::fs::{create_dir_all, remove_dir_all, rename}; use std::io::Result; -use super::{ - generate::Generate, - sync_down::SyncDown, - sync_up::SyncUp, - update::Update -}; -use crate::configuration::Configuration; pub struct Add; @@ -21,7 +16,7 @@ impl super::Command for Add { vec![Box::new(SyncDown::new())] } - fn execute(&self, _: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> { + fn execute(&self, _: Option<&String>, configuration: &Configuration, _: &str) -> Result<()> { create_dir_all(&configuration.posts_directory)?; for i in (0..configuration.max_posts - 1).rev() { let source = configuration.posts_directory.join(i.to_string()); @@ -41,7 +36,7 @@ impl super::Command for Add { vec![ Box::new(Update::new()), Box::new(Generate::new()), - Box::new(SyncUp::new()) + Box::new(SyncUp::new()), ] } -- cgit