Skip to content

Commit 79177cd

Browse files
committed
Deprecate unusable structs without a public constructor
1 parent 924b501 commit 79177cd

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/codecs/gif.rs

+3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ impl<R: Read> GifDecoder<R> {
6868
}
6969

7070
/// Wrapper struct around a `Cursor<Vec<u8>>`
71+
#[allow(dead_code)]
72+
#[deprecated]
7173
pub struct GifReader<R>(Cursor<Vec<u8>>, PhantomData<R>);
74+
#[allow(deprecated)]
7275
impl<R> Read for GifReader<R> {
7376
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
7477
self.0.read(buf)

src/codecs/tiff.rs

+3
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ impl ImageError {
167167
}
168168

169169
/// Wrapper struct around a `Cursor<Vec<u8>>`
170+
#[allow(dead_code)]
171+
#[deprecated]
170172
pub struct TiffReader<R>(Cursor<Vec<u8>>, PhantomData<R>);
173+
#[allow(deprecated)]
171174
impl<R> Read for TiffReader<R> {
172175
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
173176
self.0.read(buf)

src/dynimage.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1395,6 +1395,7 @@ mod test {
13951395
// Test that structs wrapping a DynamicImage are able to auto-derive the Default trait
13961396
// ensures that DynamicImage implements Default (if it didn't, this would cause a compile error).
13971397
#[derive(Default)]
1398+
#[allow(dead_code)]
13981399
struct Foo {
13991400
_image: super::DynamicImage,
14001401
}

0 commit comments

Comments
 (0)