提交 ce924377 编写于 作者: J Jorge Aparicio

libtest: use `#[deriving(Copy)]`

上级 64234b35
......@@ -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<String,MetricChange>;
// 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<Regex>,
pub run_ignored: bool,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册