@@ -30,7 +30,7 @@ fn sha1(data: ~str) -> ~str unsafe {
30
30
let bytes = str::to_bytes(data);
31
31
let hash = crypto::SHA1(vec::raw::to_ptr(bytes),
32
32
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));
34
34
}
35
35
36
36
fn main(args: ~[~str]) {
@@ -132,7 +132,7 @@ fn sha1(data: ~str) -> ~str {
132
132
let bytes = str::to_bytes(data);
133
133
let hash = crypto::SHA1(vec::raw::to_ptr(bytes),
134
134
vec::len(bytes), ptr::null());
135
- return as_hex(vec::raw:: from_buf(hash, 20));
135
+ return as_hex(vec::from_buf(hash, 20));
136
136
}
137
137
}
138
138
~~~~
@@ -177,7 +177,7 @@ Let's look at our `sha1` function again.
177
177
let bytes = str::to_bytes(data);
178
178
let hash = crypto::SHA1(vec::raw::to_ptr(bytes),
179
179
vec::len(bytes), ptr::null());
180
- return as_hex(vec::raw:: from_buf(hash, 20));
180
+ return as_hex(vec::from_buf(hash, 20));
181
181
# }
182
182
# }
183
183
~~~~
@@ -198,7 +198,7 @@ unsafe null pointer of type `*u8`. (Rust generics are awesome
198
198
like that: they can take the right form depending on the type that they
199
199
are expected to return.)
200
200
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
202
202
unsafe pointer that ` SHA1 ` returned. SHA1 digests are always
203
203
twenty bytes long, so we can pass ` 20 ` for the length of the new
204
204
vector.
0 commit comments