From 8766e4412b95cfa0288683748cc20aba81a64d08 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sat, 4 Jan 2025 02:20:55 +0100 Subject: Address pedantic issues --- src/file_handler/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/file_handler/mod.rs') diff --git a/src/file_handler/mod.rs b/src/file_handler/mod.rs index 522bcbf..e8a446b 100644 --- a/src/file_handler/mod.rs +++ b/src/file_handler/mod.rs @@ -8,7 +8,7 @@ use std::fs::read_to_string; use std::path::{Path, PathBuf}; pub struct FileHandler { - pub strategies: Vec>, + pub strategies: Vec>, pub layout: Option, } @@ -27,7 +27,7 @@ impl Default for FileHandler { impl FileHandler { pub fn identify(&self, path: &Path) -> FileType { - for strategy in self.strategies.iter() { + for strategy in &self.strategies { if strategy.is(path) { return strategy.identify(); } @@ -53,9 +53,9 @@ impl FileHandler { gemini_destination: &Path, files: &[File], ) { - files.iter().for_each(|file| { + for file in files { self.handle(source, html_destination, gemini_destination, file); - }); + } } pub fn handle( @@ -80,7 +80,7 @@ impl FileHandler { } } -pub trait FileHandlerStrategy { +pub trait Strategy { fn is(&self, path: &Path) -> bool; fn identify(&self) -> FileType; fn can_handle(&self, file_type: &FileType) -> bool; @@ -182,7 +182,7 @@ mod tests { file_type: FileType, } - impl FileHandlerStrategy for MockStrategy { + impl Strategy for MockStrategy { fn is(&self, _path: &Path) -> bool { self.is_match } -- cgit