From a8cf28d4286eedab0f32350df32ce4667b0757db Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 8 Mar 2014 21:41:31 -0800 Subject: [PATCH] Stop using deriving for types with phantom params --- src/types/range.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/types/range.rs b/src/types/range.rs index 0fe155c2..da634b2b 100644 --- a/src/types/range.rs +++ b/src/types/range.rs @@ -1,8 +1,6 @@ //! Types dealing with ranges of values #[macro_escape]; -extern crate extra; - use std::cmp; use std::fmt; use std::i32; @@ -141,11 +139,9 @@ trait BoundSided { } /// A tag type representing an upper bound -#[deriving(Eq,Clone)] pub enum UpperBound {} /// A tag type representing a lower bound -#[deriving(Eq,Clone)] pub enum LowerBound {} impl BoundSided for UpperBound { @@ -172,7 +168,6 @@ pub enum BoundType { /// Represents a one-sided bound. /// /// The side is determined by the `S` phantom parameter. -#[deriving(Clone)] pub struct RangeBound { /// The value of the bound value: T, @@ -180,6 +175,15 @@ pub struct RangeBound { type_: BoundType } +impl Clone for RangeBound { + fn clone(&self) -> RangeBound { + RangeBound { + value: self.value.clone(), + type_: self.type_.clone(), + } + } +} + impl fmt::Show for RangeBound { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { let chars = match self.type_ {