diff options
author | cc <cc@localhost> | 2025-08-20 18:59:47 -0700 |
---|---|---|
committer | cc <cc@localhost> | 2025-08-20 18:59:59 -0700 |
commit | b0ff49fdd4ae82af5cf89180078ea7314072c29f (patch) | |
tree | 0287a8cf3f04f7a040578a4e14ec446a47b6c4a7 /src/lib.rs | |
parent | 27d77b602e2d43a8bab413d69b86c38e53435a8e (diff) |
Add binary file output function
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -1,4 +1,7 @@ pub mod tiff; +mod binfile; + +pub use binfile::dump_u32_vec; pub const TEST_IMAGE_PATH: &str = "../test.tif"; pub const TEST_OUTPUT_PATH: &str = "../test.bin"; @@ -77,15 +80,9 @@ mod tests { #[test] fn tiff_data_dump_test() { - use std::fs::File; - use std::io::Write; tiff::ignore_warnings(); if let Some(standard_format) = tiff::as_standard_format(TEST_IMAGE_PATH) { - if let Ok(mut file) = File::create(TEST_OUTPUT_PATH) { - for value in standard_format { - let _ = file.write_all(&value.to_le_bytes()); - } - } + dump_u32_vec(TEST_OUTPUT_PATH, standard_format).expect("File output error"); } else { assert!(false); } |