diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 56af8785a76d47356d5035ca855cfb86c6eb32a8..5b04a1fed896c8f8a1470ec1d145e65133fab5e7 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -110,15 +110,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { } } -#[deriving(Clone)] +#[deriving(Clone, Copy)] enum NamePadding { PadNone, PadOnLeft, PadOnRight, } -impl Copy for NamePadding {} - impl TestDesc { fn padded_name(&self, column_count: uint, align: NamePadding) -> String { let mut name = String::from_str(self.name.as_slice()); @@ -215,14 +213,12 @@ pub struct TestDescAndFn { pub testfn: TestFn, } -#[deriving(Clone, Encodable, Decodable, PartialEq, Show)] +#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Show)] pub struct Metric { value: f64, noise: f64 } -impl Copy for Metric {} - impl Metric { pub fn new(value: f64, noise: f64) -> Metric { Metric {value: value, noise: noise} @@ -240,7 +236,7 @@ fn clone(&self) -> MetricMap { } /// Analysis of a single change in metric -#[deriving(PartialEq, Show)] +#[deriving(Copy, PartialEq, Show)] pub enum MetricChange { LikelyNoise, MetricAdded, @@ -249,8 +245,6 @@ pub enum MetricChange { Regression(f64) } -impl Copy for MetricChange {} - pub type MetricDiff = BTreeMap; // The default console test runner. It accepts the command line @@ -287,14 +281,13 @@ pub fn test_main_static(args: &[String], tests: &[TestDescAndFn]) { test_main(args, owned_tests) } +#[deriving(Copy)] pub enum ColorConfig { AutoColor, AlwaysColor, NeverColor, } -impl Copy for ColorConfig {} - pub struct TestOpts { pub filter: Option, pub run_ignored: bool,