X-Git-Url: https://git.r.bdr.sh/rbdr/page/blobdiff_plain/5732d284ebc2cc2cbde0f050443b8f137dbf585b..b03284133baa6339fe4adf48e4a6499ef3ac287b:/src/file_handler/mod.rs diff --git a/src/file_handler/mod.rs b/src/file_handler/mod.rs index a079c74..522bcbf 100644 --- a/src/file_handler/mod.rs +++ b/src/file_handler/mod.rs @@ -156,7 +156,7 @@ mod tests { let files = vec![ create_test_internal_file("test.gmi", FileType::Gemini), create_test_internal_file( - &layout_path.to_str().expect("Could not encode layout"), + layout_path.to_str().expect("Could not encode layout"), FileType::Layout, ), create_test_internal_file("regular.html", FileType::File), @@ -231,18 +231,20 @@ mod tests { #[test] fn test_handle_with_layout() { - let mut handler = FileHandler::default(); - handler.layout = Some("test layout".to_string()); + let handler = FileHandler { + layout: Some("test layout".to_string()), + ..Default::default() + }; let test_dir = setup_test_dir(); - create_dir_all(&test_dir.join("output_html")) + create_dir_all(test_dir.join("output_html")) .expect("Could not create output html test directory"); - create_dir_all(&test_dir.join("output_gemini")) + create_dir_all(test_dir.join("output_gemini")) .expect("Could not create output gemini test directory"); let test_path = test_dir.join("test.gmi"); create_test_file(&test_path, ""); let file = create_test_internal_file( - &test_path + test_path .to_str() .expect("Could not encode gemini test file"), FileType::Gemini, @@ -279,33 +281,33 @@ mod tests { create_test_file(&test_dir.join("test1.gmi"), ""); create_test_file(&test_dir.join("test2.gmi"), ""); create_test_file(&test_dir.join("test3.gmi"), ""); - create_dir_all(&test_dir.join("output_html")) + create_dir_all(test_dir.join("output_html")) .expect("Could not create output html test directory"); - create_dir_all(&test_dir.join("output_gemini")) + create_dir_all(test_dir.join("output_gemini")) .expect("Could not create output gemini test directory"); let mut handler = FileHandler::default(); - let files = vec![ + let files = [ create_test_internal_file( - &test_dir + test_dir .join("test1.gmi") .to_str() .expect("Could not encode test1"), FileType::Gemini, ), create_test_internal_file( - &layout_path.to_str().expect("Could not encode layout"), + layout_path.to_str().expect("Could not encode layout"), FileType::Layout, ), create_test_internal_file( - &test_dir + test_dir .join("test2.gmi") .to_str() .expect("Could not encode test2"), FileType::Gemini, ), create_test_internal_file( - &test_dir + test_dir .join("test3.gmi") .to_str() .expect("Could not encode test3"),