File tree Expand file tree Collapse file tree 3 files changed +7
-20
lines changed Expand file tree Collapse file tree 3 files changed +7
-20
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 235109f8d21727748dd70fa2e2763eb050161ab0
2
+ refs/heads/master: f9623f00567ac0a9ca86abc84613d90d113dbc2b
Original file line number Diff line number Diff line change @@ -25,11 +25,9 @@ type sha1 =
25
25
// Reset the sha1 state for reuse. This is called
26
26
// automatically during construction
27
27
obj {
28
- fn input ( & vec[ u8 ] ) ;
29
- fn input_ivec ( & [ u8 ] ) ;
28
+ fn input ( & [ u8 ] ) ;
30
29
fn input_str ( & str ) ;
31
- fn result ( ) -> vec[ u8 ] ;
32
- fn result_ivec ( ) -> [ u8 ] ;
30
+ fn result ( ) -> [ u8 ] ;
33
31
fn result_str ( ) -> str ;
34
32
fn reset ( ) ;
35
33
} ;
@@ -239,20 +237,9 @@ fn mk_sha1() -> sha1 {
239
237
st. h . ( 4 ) = 0xC3D2E1F0u32 ;
240
238
st. computed = false ;
241
239
}
242
- fn input ( msg : & vec[ u8 ] ) {
243
- let m = ~[ ] ;
244
- for b: u8 in msg { m += ~[ b] ; }
245
- add_input ( st, m) ;
246
- }
247
- fn input_ivec ( msg : & [ u8 ] ) { add_input ( st, msg) ; }
240
+ fn input ( msg : & [ u8 ] ) { add_input ( st, msg) ; }
248
241
fn input_str ( msg : & str ) { add_input ( st, str:: bytes ( msg) ) ; }
249
- fn result ( ) -> vec[ u8 ] {
250
- let rivec = mk_result ( st) ;
251
- let rvec = [ ] ;
252
- for b: u8 in rivec { rvec += [ b] ; }
253
- ret rvec;
254
- }
255
- fn result_ivec ( ) -> [ u8 ] { ret mk_result ( st) ; }
242
+ fn result ( ) -> [ u8 ] { ret mk_result ( st) ; }
256
243
fn result_str ( ) -> str {
257
244
let r = mk_result ( st) ;
258
245
let s = "" ;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ fn test() {
76
76
let sh = sha1:: mk_sha1 ( ) ;
77
77
for t: test in tests {
78
78
sh. input_str ( t. input ) ;
79
- let out = sh. result_ivec ( ) ;
79
+ let out = sh. result ( ) ;
80
80
check_vec_eq ( t. output , out) ;
81
81
sh. reset ( ) ;
82
82
}
@@ -91,7 +91,7 @@ fn test() {
91
91
sh. input_str ( str:: substr ( t. input , len - left, take) ) ;
92
92
left = left - take;
93
93
}
94
- let out = sh. result_ivec ( ) ;
94
+ let out = sh. result ( ) ;
95
95
check_vec_eq ( t. output , out) ;
96
96
sh. reset ( ) ;
97
97
}
You can’t perform that action at this time.
0 commit comments