diff options
author | Devon Sawatsky <novedevo@gmail.com> | 2023-12-24 22:40:43 -0800 |
---|---|---|
committer | Devon Sawatsky <novedevo@gmail.com> | 2023-12-24 22:40:43 -0800 |
commit | 2a39c5e4360303d9565d51d30111ce028a1c960e (patch) | |
tree | 80d0472a29fe3381eb9ffa09bbd0f890181989e2 | |
parent | 2230e8d37c16e864821db23636f2bad5c14d8d3c (diff) | |
download | gifed-2a39c5e4360303d9565d51d30111ce028a1c960e.tar.gz gifed-2a39c5e4360303d9565d51d30111ce028a1c960e.zip |
change things that didn't really need to be changed
-rw-r--r-- | gifed/src/block/palette.rs | 8 | ||||
-rw-r--r-- | gifed/src/gif.rs | 1 | ||||
-rw-r--r-- | gifed/src/writer/imagebuilder.rs | 6 |
3 files changed, 5 insertions, 10 deletions
diff --git a/gifed/src/block/palette.rs b/gifed/src/block/palette.rs index 1c660df..b1414b4 100644 --- a/gifed/src/block/palette.rs +++ b/gifed/src/block/palette.rs @@ -179,7 +179,7 @@ mod test { vec_tuple_test(vec![(1, 2, 3), (4, 5, 6)], &[1, 2, 3, 4, 5, 6]) } - fn test_n_with_padding(real_count: usize, exected_padding_bytes: usize) { + fn test_n_with_padding(real_count: usize, expected_padding_bytes: usize) { let mut palette = Palette::new(); let mut expected = vec![]; @@ -189,11 +189,7 @@ mod test { expected.extend_from_slice(&[x, x, x]) } - // yes, this is really how I'm doing it. I have... trust issues with - // myself and iter::repeat. i hope you understand - for _ in 0..exected_padding_bytes { - expected.push(0x00); - } + expected.resize(expected.len() + expected_padding_bytes, 0x00); let bytes = palette.as_bytes(); assert_eq!(expected, bytes.as_slice()) diff --git a/gifed/src/gif.rs b/gifed/src/gif.rs index 5b1cfd7..87a310f 100644 --- a/gifed/src/gif.rs +++ b/gifed/src/gif.rs @@ -7,7 +7,6 @@ use crate::{ Block, CompressedImage, IndexedImage, Palette, ScreenDescriptor, Version, }, writer::EncodeBlock, - EncodeError, }; #[derive(Clone, Debug)] diff --git a/gifed/src/writer/imagebuilder.rs b/gifed/src/writer/imagebuilder.rs index 2163477..2cbc0c2 100644 --- a/gifed/src/writer/imagebuilder.rs +++ b/gifed/src/writer/imagebuilder.rs @@ -44,9 +44,9 @@ impl ImageBuilder { self } - /// Time to wait, in hundreths of a second, before this image is drawn - pub fn delay(mut self, hundreths: u16) -> Self { - self.delay = hundreths; + /// Time to wait, in hundredths of a second, before this image is drawn + pub fn delay(mut self, hundredths: u16) -> Self { + self.delay = hundredths; self } |