From 9fdca30f9e5946b4cf03712b3d9955a4098bd220 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 17 Oct 2022 00:31:27 +0100 Subject: [PATCH] Make `Bytes` pub --- src/decode.rs | 2 +- tests/test_misc.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/test_misc.rs diff --git a/src/decode.rs b/src/decode.rs index b9fb6f2..ce105a5 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -230,7 +230,7 @@ pub trait Reader: Sized { fn decode_image(&mut self, out: &mut [u8], channels: u8, src_channels: u8) -> Result<()>; } -struct Bytes<'a>(&'a [u8]); +pub struct Bytes<'a>(&'a [u8]); impl<'a> Bytes<'a> { #[inline] diff --git a/tests/test_misc.rs b/tests/test_misc.rs new file mode 100644 index 0000000..720adf4 --- /dev/null +++ b/tests/test_misc.rs @@ -0,0 +1,6 @@ +#[test] +fn test_new_encoder() { + // this used to fail due to `Bytes` not being `pub` + let arr = [0u8]; + let _ = qoi::Decoder::new(&arr[..]); +} \ No newline at end of file