From d89fbbf044037b30e4ea68b4fbab708d0f97b472 Mon Sep 17 00:00:00 2001 From: gifnksm Date: Tue, 9 Dec 2014 23:46:07 +0900 Subject: [PATCH] Add `deriving(Copy)` for `Copy`able structs/enums/ --- src/bigint.rs | 2 +- src/complex.rs | 2 +- src/rational.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bigint.rs b/src/bigint.rs index 0952895..f89df3f 100644 --- a/src/bigint.rs +++ b/src/bigint.rs @@ -857,7 +857,7 @@ fn get_radix_base(radix: uint) -> (DoubleBigDigit, uint) { } /// A Sign is a `BigInt`'s composing element. -#[deriving(PartialEq, PartialOrd, Eq, Ord, Clone, Show, Encodable, Decodable)] +#[deriving(PartialEq, PartialOrd, Eq, Ord, Copy, Clone, Show, Encodable, Decodable)] pub enum Sign { Minus, NoSign, Plus } impl Neg for Sign { diff --git a/src/complex.rs b/src/complex.rs index b5f7157..45d9f6f 100644 --- a/src/complex.rs +++ b/src/complex.rs @@ -21,7 +21,7 @@ use {Zero, One, Num}; // probably doesn't map to C's _Complex correctly. /// A complex number in Cartesian form. -#[deriving(PartialEq, Clone, Hash, Encodable, Decodable)] +#[deriving(PartialEq, Copy, Clone, Hash, Encodable, Decodable)] pub struct Complex { /// Real portion of the complex number pub re: T, diff --git a/src/rational.rs b/src/rational.rs index a094d60..9769805 100644 --- a/src/rational.rs +++ b/src/rational.rs @@ -22,7 +22,7 @@ use bigint::{BigInt, BigUint, Sign}; use {Num, Signed, Zero, One}; /// Represents the ratio between 2 numbers. -#[deriving(Clone, Hash, Encodable, Decodable)] +#[deriving(Copy, Clone, Hash, Encodable, Decodable)] #[allow(missing_docs)] pub struct Ratio { numer: T,