File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11//! Types dealing with ranges of values
22#[ macro_escape] ;
33
4- extern crate extra;
5-
64use std:: cmp;
75use std:: fmt;
86use std:: i32;
@@ -141,11 +139,9 @@ trait BoundSided {
141139}
142140
143141/// A tag type representing an upper bound
144- #[ deriving( Eq , Clone ) ]
145142pub enum UpperBound { }
146143
147144/// A tag type representing a lower bound
148- #[ deriving( Eq , Clone ) ]
149145pub enum LowerBound { }
150146
151147impl BoundSided for UpperBound {
@@ -172,14 +168,22 @@ pub enum BoundType {
172168/// Represents a one-sided bound.
173169///
174170/// The side is determined by the `S` phantom parameter.
175- #[ deriving( Clone ) ]
176171pub struct RangeBound < S , T > {
177172 /// The value of the bound
178173 value : T ,
179174 /// The type of the bound
180175 type_ : BoundType
181176}
182177
178+ impl < S : BoundSided , T : Clone > Clone for RangeBound < S , T > {
179+ fn clone ( & self ) -> RangeBound < S , T > {
180+ RangeBound {
181+ value : self . value . clone ( ) ,
182+ type_ : self . type_ . clone ( ) ,
183+ }
184+ }
185+ }
186+
183187impl < S : BoundSided , T : fmt:: Show > fmt:: Show for RangeBound < S , T > {
184188 fn fmt ( & self , formatter : & mut fmt:: Formatter ) -> fmt:: Result {
185189 let chars = match self . type_ {
You can’t perform that action at this time.
0 commit comments