File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 470a3014673d25a9056fddcdea124890dacc41aa
4
+ refs/heads/snap-stage3: 5c721bd8108476fb40bf3510002eba8e6eea4c91
5
5
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change 2
2
#[ forbid( deprecated_mode) ] ;
3
3
#[ forbid( deprecated_pattern) ] ;
4
4
5
+ use cmp:: Eq ;
6
+
5
7
/**
6
8
* Miscellaneous helpers for common patterns.
7
9
*/
@@ -62,7 +64,7 @@ mod tests {
62
64
fn identity_crisis ( ) {
63
65
// Writing a test for the identity function. How did it come to this?
64
66
let x = ~[ ( 5 , false ) ] ;
65
- assert x == id ( copy x) ;
67
+ assert x. eq ( id ( copy x) ) ;
66
68
}
67
69
#[ test]
68
70
fn test_swap ( ) {
Original file line number Diff line number Diff line change @@ -90,10 +90,33 @@ type Tm_ = {
90
90
tm_nsec : i32 , // nanoseconds
91
91
} ;
92
92
93
+ impl Tm_ : Eq {
94
+ pure fn eq ( & & other: Tm_ ) -> bool {
95
+ self . tm_sec == other. tm_sec &&
96
+ self . tm_min == other. tm_min &&
97
+ self . tm_hour == other. tm_hour &&
98
+ self . tm_mday == other. tm_mday &&
99
+ self . tm_mon == other. tm_mon &&
100
+ self . tm_year == other. tm_year &&
101
+ self . tm_wday == other. tm_wday &&
102
+ self . tm_yday == other. tm_yday &&
103
+ self . tm_isdst == other. tm_isdst &&
104
+ self . tm_gmtoff == other. tm_gmtoff &&
105
+ self . tm_zone == other. tm_zone &&
106
+ self . tm_nsec == other. tm_nsec
107
+ }
108
+ }
109
+
93
110
enum Tm {
94
111
Tm_ ( Tm_ )
95
112
}
96
113
114
+ impl Tm : Eq {
115
+ pure fn eq ( & & other: Tm ) -> bool {
116
+ * self == * other
117
+ }
118
+ }
119
+
97
120
fn empty_tm ( ) -> Tm {
98
121
Tm_ ( {
99
122
tm_sec: 0_i32 ,
You can’t perform that action at this time.
0 commit comments