@@ -30,7 +30,7 @@ fn sha1(data: ~str) -> ~str unsafe {
3030 let bytes = str::to_bytes(data);
3131 let hash = crypto::SHA1(vec::raw::to_ptr(bytes),
3232 vec::len(bytes) as c_uint, ptr::null());
33- return as_hex(vec::raw:: from_buf(hash, 20));
33+ return as_hex(vec::from_buf(hash, 20));
3434}
3535
3636fn main(args: ~[~str]) {
@@ -132,7 +132,7 @@ fn sha1(data: ~str) -> ~str {
132132 let bytes = str::to_bytes(data);
133133 let hash = crypto::SHA1(vec::raw::to_ptr(bytes),
134134 vec::len(bytes), ptr::null());
135- return as_hex(vec::raw:: from_buf(hash, 20));
135+ return as_hex(vec::from_buf(hash, 20));
136136 }
137137}
138138~~~~
@@ -177,7 +177,7 @@ Let's look at our `sha1` function again.
177177let bytes = str::to_bytes(data);
178178let hash = crypto::SHA1(vec::raw::to_ptr(bytes),
179179 vec::len(bytes), ptr::null());
180- return as_hex(vec::raw:: from_buf(hash, 20));
180+ return as_hex(vec::from_buf(hash, 20));
181181# }
182182# }
183183~~~~
@@ -198,7 +198,7 @@ unsafe null pointer of type `*u8`. (Rust generics are awesome
198198like that: they can take the right form depending on the type that they
199199are expected to return.)
200200
201- Finally, ` vec::raw:: from_buf ` builds up a new ` ~[u8] ` from the
201+ Finally, ` vec::from_buf ` builds up a new ` ~[u8] ` from the
202202unsafe pointer that ` SHA1 ` returned. SHA1 digests are always
203203twenty bytes long, so we can pass ` 20 ` for the length of the new
204204vector.
0 commit comments