X-Git-Url: https://git.r.bdr.sh/rbdr/page/blobdiff_plain/4fd89b808cabc8afb0d75b9700be1da96989c4b7..0e3bcda2ce1ba4bff5d457e48a82db6e6289aad6:/src/file_handler/mod.rs diff --git a/src/file_handler/mod.rs b/src/file_handler/mod.rs index 53aaba9..a106c27 100644 --- a/src/file_handler/mod.rs +++ b/src/file_handler/mod.rs @@ -58,7 +58,8 @@ impl FileHandler { pub fn handle(&self, source: &PathBuf, destination: &PathBuf, file: &File) { for strategy in self.strategies.iter() { if strategy.can_handle(&file.file_type) { - return strategy.handle(file); + let layout = self.layout.as_ref().unwrap(); + return strategy.handle(source, destination, file, layout); } } } @@ -68,7 +69,7 @@ pub trait FileHandlerStrategy { fn is(&self, path: &PathBuf) -> bool; fn identify(&self) -> FileType; fn can_handle(&self, file_type: &FileType) -> bool; - fn handle(&self, file: &File); + fn handle(&self, source: &PathBuf, destination: &PathBuf, file: &File, layout: &String); } pub enum FileType {