Skip to content

Commit ea58de3

Browse files
committed
Derive Clone when deriving Copy
As per rust-lang/rust#23860, Copy now extends Clone. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 73ed44f commit ea58de3

File tree

11 files changed

+19
-19
lines changed

11 files changed

+19
-19
lines changed

src/gif/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use super::{Extension, Block, DisposalMethod};
1616

1717
use math::nq;
1818

19-
#[derive(Debug, Copy)]
19+
#[derive(Debug, Clone, Copy)]
2020
#[allow(unused_qualifications)]
2121
/// The color mode the encoder will use to encode the image.
2222
pub enum ColorMode {

src/image.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub enum DecodingBuffer<'a> {
9494

9595
/// An enumeration of supported image formats.
9696
/// Not all formats support both encoding and decoding.
97-
#[derive(Copy, PartialEq, Eq, Debug)]
97+
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
9898
pub enum ImageFormat {
9999
/// An Image in PNG Format
100100
PNG,

src/imageops/colorops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub trait ColorMap {
128128
}
129129

130130
/// A bi-level color map
131-
#[derive(Copy)]
131+
#[derive(Clone, Copy)]
132132
pub struct BiLevel;
133133

134134
impl ColorMap for BiLevel {

src/imageops/sample.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use image::GenericImage;
1919
use math::utils::clamp;
2020

2121
/// Available Sampling Filters
22-
#[derive(Copy)]
22+
#[derive(Clone, Copy)]
2323
pub enum FilterType {
2424
/// Nearest Neighbor
2525
Nearest,

src/math/nq.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const BETAGAMMA: f64 = BETA * GAMMA;
5151
// that it is divisible by all four primes
5252
const PRIMES: [usize; 4] = [499, 491, 478, 503];
5353

54-
#[derive(Copy)]
54+
#[derive(Clone, Copy)]
5555
struct Quad<T> {
5656
r: T,
5757
g: T,

src/png/decoder.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use super::zlib::ZlibDecoder;
2020
pub static PNGSIGNATURE: [u8; 8] = [137, 80, 78, 71, 13, 10, 26, 10];
2121

2222

23-
#[derive(Copy, PartialEq)]
23+
#[derive(Clone, Copy, PartialEq)]
2424
enum PNGState {
2525
Start,
2626
HaveSignature,
@@ -33,7 +33,7 @@ enum PNGState {
3333
HaveIEND
3434
}
3535

36-
#[derive(Copy, FromPrimitive, Debug, PartialEq)]
36+
#[derive(Clone, Copy, FromPrimitive, Debug, PartialEq)]
3737
enum InterlaceMethod {
3838
None = 0,
3939
Adam7 = 1
@@ -51,7 +51,7 @@ enum InterlaceMethod {
5151
/// 56565656
5252
/// 77777777
5353
///
54-
#[derive(Copy)]
54+
#[derive(Clone, Copy)]
5555
struct Adam7Iterator {
5656
line: u32,
5757
lines: u32,

src/png/hash.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! *http://en.wikipedia.org/wiki/Cyclic_redundancy_check - Cyclic Redundancy Check
77
88
/// An Implementation of the Adler-32 checksum
9-
#[derive(Copy)]
9+
#[derive(Clone, Copy)]
1010
pub struct Adler32 {
1111
s1: u32,
1212
s2: u32
@@ -97,7 +97,7 @@ const CRC_TABLE: [u32; 256] = [
9797
];
9898

9999
/// An Implementation of the Crc-32 checksum
100-
#[derive(Copy)]
100+
#[derive(Clone, Copy)]
101101
pub struct Crc32 {
102102
crc: u32,
103103
}

src/tiff/decoder.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use super::stream::{
2626
LZWReader
2727
};
2828

29-
#[derive(Copy, Debug, FromPrimitive, PartialEq)]
29+
#[derive(Clone, Copy, Debug, FromPrimitive, PartialEq)]
3030
enum PhotometricInterpretation {
3131
WhiteIsZero = 0,
3232
BlackIsZero = 1,
@@ -38,7 +38,7 @@ enum PhotometricInterpretation {
3838
CIELab = 8,
3939
}
4040

41-
#[derive(Copy, Debug, FromPrimitive)]
41+
#[derive(Clone, Copy, Debug, FromPrimitive)]
4242
enum CompressionMethod {
4343
None = 1,
4444
Huffman = 2,
@@ -49,13 +49,13 @@ enum CompressionMethod {
4949
PackBits = 32773
5050
}
5151

52-
#[derive(Copy, Debug, FromPrimitive)]
52+
#[derive(Clone, Copy, Debug, FromPrimitive)]
5353
enum PlanarConfiguration {
5454
Chunky = 1,
5555
Planar = 2
5656
}
5757

58-
#[derive(Copy, Debug, FromPrimitive)]
58+
#[derive(Clone, Copy, Debug, FromPrimitive)]
5959
enum Predictor {
6060
None = 1,
6161
Horizontal = 2

src/tiff/ifd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ macro_rules! tags {
1414
)*} => {
1515

1616
/// TIFF tag
17-
#[derive(Copy, PartialEq, Eq, Debug, Hash)]
17+
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
1818
pub enum Tag {
1919
$($tag,)*
2020
Unknown(u16)
@@ -74,7 +74,7 @@ tags!{
7474
Predictor 317;
7575
}
7676

77-
#[derive(Copy, Debug, FromPrimitive)]
77+
#[derive(Clone, Copy, Debug, FromPrimitive)]
7878
pub enum Type {
7979
BYTE = 1,
8080
ASCII = 2,

src/tiff/stream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use byteorder::{self, ReadBytesExt, BigEndian, LittleEndian};
66
use utils::{lzw, bitstream};
77

88
/// Byte order of the TIFF file.
9-
#[derive(Copy, Debug)]
9+
#[derive(Clone, Copy, Debug)]
1010
pub enum ByteOrder {
1111
/// little endian byte order
1212
LittleEndian,

src/webp/vp8.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ impl BoolReader {
728728
}
729729
}
730730

731-
#[derive(Copy)]
731+
#[derive(Clone, Copy)]
732732
struct MacroBlock {
733733
bpred: [i8; 16],
734734
complexity: [u8; 9],
@@ -780,7 +780,7 @@ pub struct Frame {
780780
sharpness_level: u8,
781781
}
782782

783-
#[derive(Copy, Default)]
783+
#[derive(Clone, Copy, Default)]
784784
struct Segment {
785785
ydc: i16,
786786
yac: i16,

0 commit comments

Comments
 (0)