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 @@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
- refs/heads/dist-snap: 470a3014673d25a9056fddcdea124890dacc41aa
10
+ refs/heads/dist-snap: 5c721bd8108476fb40bf3510002eba8e6eea4c91
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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