diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-09-18 21:41:37 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-09-19 10:52:59 -0700 |
| commit | 9cf271fe96b474d514b1052935db70c4056cf076 (patch) | |
| tree | 7a6fb31efeaa4de91317c16aca824153aaaf988c /src/libstd/sha1.rs | |
| parent | 62b7f4d800325b46002c47d23b58a9f2b7fabb9b (diff) | |
| download | rust-9cf271fe96b474d514b1052935db70c4056cf076.tar.gz rust-9cf271fe96b474d514b1052935db70c4056cf076.zip | |
De-mode vec::each() and many of the str iteration routines
Note that the method foo.each() is not de-moded, nor the other vec routines.
Diffstat (limited to 'src/libstd/sha1.rs')
| -rw-r--r-- | src/libstd/sha1.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libstd/sha1.rs b/src/libstd/sha1.rs index 9808b15dc66..c16e29f2770 100644 --- a/src/libstd/sha1.rs +++ b/src/libstd/sha1.rs @@ -66,7 +66,7 @@ fn sha1() -> Sha1 { fn add_input(st: &Sha1State, msg: &[u8]) { assert (!st.computed); for vec::each(msg) |element| { - st.msg_block[st.msg_block_idx] = element; + st.msg_block[st.msg_block_idx] = *element; st.msg_block_idx += 1u; st.len_low += 8u32; if st.len_low == 0u32 { @@ -161,7 +161,7 @@ fn sha1() -> Sha1 { fn mk_result(st: &Sha1State) -> ~[u8] { if !(*st).computed { pad_msg(st); (*st).computed = true; } let mut rs: ~[u8] = ~[]; - for vec::each_mut_ref((*st).h) |ptr_hpart| { + for vec::each_mut((*st).h) |ptr_hpart| { let hpart = *ptr_hpart; let a = (hpart >> 24u32 & 0xFFu32) as u8; let b = (hpart >> 16u32 & 0xFFu32) as u8; @@ -240,7 +240,9 @@ fn sha1() -> Sha1 { fn result_str() -> ~str { let rr = mk_result(&self); let mut s = ~""; - for vec::each(rr) |b| { s += uint::to_str(b as uint, 16u); } + for vec::each(rr) |b| { + s += uint::to_str(*b as uint, 16u); + } return s; } } |
