Skip to content

Commit 9f704d8

Browse files
committed
fixed clippy, doctest improvements
1 parent c37e067 commit 9f704d8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tile.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,16 @@ impl PredictorInfo<'_> {
6969
/// # planar_configuration: PlanarConfiguration::Chunky,
7070
/// };
7171
///
72+
/// assert_eq!(info.chunk_width_pixels(0).unwrap(), (8));
7273
/// assert_eq!(info.chunk_width_pixels(1).unwrap(), (7));
7374
/// info.chunk_width_pixels(2).unwrap_err();
7475
/// ```
7576
pub fn chunk_width_pixels(&self, x: u32) -> AsyncTiffResult<u32> {
7677
if x >= self.chunks_across() {
77-
return Err(crate::error::AsyncTiffError::TileIndexError(
78+
Err(crate::error::AsyncTiffError::TileIndexError(
7879
x,
7980
self.chunks_across(),
80-
));
81+
))
8182
} else if x == self.chunks_across() - 1 {
8283
// last chunk
8384
Ok(self.image_width - self.chunk_width * x)
@@ -108,6 +109,7 @@ impl PredictorInfo<'_> {
108109
/// # planar_configuration: PlanarConfiguration::Chunky,
109110
/// };
110111
///
112+
/// assert_eq!(info.chunk_height_pixels(0).unwrap(), (8));
111113
/// assert_eq!(info.chunk_height_pixels(1).unwrap(), (7));
112114
/// info.chunk_height_pixels(2).unwrap_err();
113115
/// ```

0 commit comments

Comments
 (0)