]> git.lizzy.rs Git - rust.git/commitdiff
fmt: derive Eq for all types
authorAndrew Paseltiner <apaseltiner@gmail.com>
Mon, 7 Jan 2013 22:05:13 +0000 (17:05 -0500)
committerAndrew Paseltiner <apaseltiner@gmail.com>
Mon, 7 Jan 2013 22:22:01 +0000 (17:22 -0500)
src/libcore/extfmt.rs

index f92ed6ad8347c14dc8959e44f1a772c1619d25df..3caafc47b926e4f1ad16409d173812bcb6f41006 100644 (file)
@@ -102,10 +102,13 @@ pub mod ct {
     use str;
     use vec;
 
+    #[deriving_eq]
     pub enum Signedness { Signed, Unsigned, }
 
+    #[deriving_eq]
     pub enum Caseness { CaseUpper, CaseLower, }
 
+    #[deriving_eq]
     pub enum Ty {
         TyBool,
         TyStr,
@@ -118,6 +121,7 @@ pub enum Ty {
         TyPoly,
     }
 
+    #[deriving_eq]
     pub enum Flag {
         FlagLeftJustify,
         FlagLeftZeroPad,
@@ -126,6 +130,7 @@ pub enum Flag {
         FlagAlternate,
     }
 
+    #[deriving_eq]
     pub enum Count {
         CountIs(uint),
         CountIsParam(uint),
@@ -133,6 +138,7 @@ pub enum Count {
         CountImplied,
     }
 
+    #[deriving_eq]
     struct Parsed<T> {
         val: T,
         next: uint
@@ -145,6 +151,7 @@ impl<T> Parsed<T> {
     }
 
     // A formatted conversion from an expression to a string
+    #[deriving_eq]
     pub struct Conv {
         param: Option<uint>,
         flags: ~[Flag],
@@ -154,6 +161,7 @@ pub struct Conv {
     }
 
     // A fragment of the output sequence
+    #[deriving_eq]
     pub enum Piece { PieceString(~str), PieceConv(Conv), }
 
     pub type ErrorFn = @fn(&str) -> !;