diff options
Diffstat (limited to 'src/file_handler/file_strategies/layout.rs')
| -rw-r--r-- | src/file_handler/file_strategies/layout.rs | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/file_handler/file_strategies/layout.rs b/src/file_handler/file_strategies/layout.rs index 9a60f12..45ef665 100644 --- a/src/file_handler/file_strategies/layout.rs +++ b/src/file_handler/file_strategies/layout.rs @@ -1,5 +1,6 @@ pub struct Strategy {} +use std::io::Result; use std::path::Path; use crate::file_handler::{File, FileType, Strategy as FileHandlerStrategy}; @@ -19,8 +20,12 @@ impl FileHandlerStrategy for Strategy { // We don't implement handling for layout, as we assume there's only one // and it got handled before. - fn handle_html(&self, _s: &Path, _d: &Path, _f: &File, _l: &str) {} - fn handle_gemini(&self, _s: &Path, _d: &Path, _f: &File) {} + fn handle_html(&self, _s: &Path, _d: &Path, _f: &File, _l: &str) -> Result<()> { + Ok(()) + } + fn handle_gemini(&self, _s: &Path, _d: &Path, _f: &File) -> Result<()> { + Ok(()) + } } #[cfg(test)] @@ -101,11 +106,15 @@ mod tests { file_type: FileType::Layout, }; - strategy.handle_html( - &PathBuf::from("source"), - &PathBuf::from("dest"), - &file, - "layout content", + assert!( + strategy + .handle_html( + &PathBuf::from("source"), + &PathBuf::from("dest"), + &file, + "layout content", + ) + .is_ok() ); } @@ -118,6 +127,10 @@ mod tests { }; // Should not panic - strategy.handle_gemini(&PathBuf::from("source"), &PathBuf::from("dest"), &file); + assert!( + strategy + .handle_gemini(&PathBuf::from("source"), &PathBuf::from("dest"), &file) + .is_ok() + ); } } |