mirror of
https://github.com/image-rs/image
synced 2024-10-18 08:42:24 +00:00
Deprecate unusable structs without a public constructor
This commit is contained in:
parent
924b501f97
commit
79177cd482
|
@ -68,7 +68,10 @@ impl<R: Read> GifDecoder<R> {
|
|||
}
|
||||
|
||||
/// Wrapper struct around a `Cursor<Vec<u8>>`
|
||||
#[allow(dead_code)]
|
||||
#[deprecated]
|
||||
pub struct GifReader<R>(Cursor<Vec<u8>>, PhantomData<R>);
|
||||
#[allow(deprecated)]
|
||||
impl<R> Read for GifReader<R> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
self.0.read(buf)
|
||||
|
|
|
@ -167,7 +167,10 @@ impl ImageError {
|
|||
}
|
||||
|
||||
/// Wrapper struct around a `Cursor<Vec<u8>>`
|
||||
#[allow(dead_code)]
|
||||
#[deprecated]
|
||||
pub struct TiffReader<R>(Cursor<Vec<u8>>, PhantomData<R>);
|
||||
#[allow(deprecated)]
|
||||
impl<R> Read for TiffReader<R> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
self.0.read(buf)
|
||||
|
|
|
@ -1395,6 +1395,7 @@ mod test {
|
|||
// Test that structs wrapping a DynamicImage are able to auto-derive the Default trait
|
||||
// ensures that DynamicImage implements Default (if it didn't, this would cause a compile error).
|
||||
#[derive(Default)]
|
||||
#[allow(dead_code)]
|
||||
struct Foo {
|
||||
_image: super::DynamicImage,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue