libextra: Add a stray deriving or two.

This commit is contained in:
Patrick Walton 2013-07-17 15:15:34 -07:00
parent 3f8d548914
commit 3d13d4b58d
2 changed files with 10 additions and 1 deletions

View File

@ -27,6 +27,7 @@ use term;
use time::precise_time_ns;
use treemap::TreeMap;
use std::clone::Clone;
use std::comm::{stream, SharedChan};
use std::either;
use std::io;
@ -93,7 +94,7 @@ pub struct TestDescAndFn {
testfn: TestFn,
}
#[deriving(Encodable,Decodable,Eq)]
#[deriving(Clone, Encodable, Decodable, Eq)]
pub struct Metric {
value: f64,
noise: f64
@ -102,6 +103,12 @@ pub struct Metric {
#[deriving(Eq)]
pub struct MetricMap(TreeMap<~str,Metric>);
impl Clone for MetricMap {
pub fn clone(&self) -> MetricMap {
MetricMap((**self).clone())
}
}
/// Analysis of a single change in metric
#[deriving(Eq)]
pub enum MetricChange {

View File

@ -34,6 +34,7 @@ use std::iterator::FromIterator;
// These would be convenient since the methods work like `each`
#[allow(missing_doc)]
#[deriving(Clone)]
pub struct TreeMap<K, V> {
priv root: Option<~TreeNode<K, V>>,
priv length: uint
@ -506,6 +507,7 @@ pub struct TreeSetIterator<'self, T> {
// Nodes keep track of their level in the tree, starting at 1 in the
// leaves and with a red child sharing the level of the parent.
#[deriving(Clone)]
struct TreeNode<K, V> {
key: K,
value: V,