From b54ea6a51b16642dc59b2d2ba4d747cf683ec418 Mon Sep 17 00:00:00 2001 From: cc Date: Wed, 20 Aug 2025 18:13:53 -0700 Subject: Reduce warnings --- src/lib.rs | 5 +++-- src/tiff.rs | 22 +--------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ebec3fc..e1ee558 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -mod tiff; +pub mod tiff; pub const TEST_IMAGE_PATH: &str = "../test.tif"; @@ -56,6 +56,7 @@ mod tests { tiff::ignore_warnings(); if let Some(t_handle) = tiff::open(TEST_IMAGE_PATH) { let channels = tiff::get_image_channels(t_handle); + assert!(channels > 0); tiff::close(t_handle); } else { assert!(false); @@ -66,7 +67,7 @@ mod tests { fn tiff_read() { tiff::ignore_warnings(); if let Some(t_handle) = tiff::open(TEST_IMAGE_PATH) { - let data = tiff::read(t_handle); + let _data = tiff::read(t_handle); tiff::close(t_handle); } else { assert!(false); diff --git a/src/tiff.rs b/src/tiff.rs index 53b8de9..6d14e81 100644 --- a/src/tiff.rs +++ b/src/tiff.rs @@ -155,27 +155,7 @@ mod tests { fn tiff_strip_read() { ignore_warnings(); if let Some(t_handle) = open(crate::TEST_IMAGE_PATH) { - let strip = read_strip(t_handle, 0); - close(t_handle); - } else { - assert!(false); - } - } - - #[test] - fn tiff_data_depth() { - ignore_warnings(); - if let Some(t_handle) = open(crate::TEST_IMAGE_PATH) { - let strip_size = get_strip_size(t_handle); - let strip_count = get_strip_count(t_handle); - let strip_depth = strip_size * strip_count; - assert!(strip_depth > 0); - let image_width = get_image_width(t_handle); - let image_height = get_image_height(t_handle); - let image_depth = image_width * image_height; - assert!(image_depth > 0); - let strip_depth = strip_depth as f64; - let image_depth = image_depth as f64; + let _strip = read_strip(t_handle, 0); close(t_handle); } else { assert!(false); -- cgit v1.2.1