Skip to content

Commit

Permalink
Fix example.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejholmes committed Dec 23, 2012
1 parent 3ee1d3e commit 0100b02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/tutorial-ffi.md
Expand Up @@ -22,7 +22,7 @@ extern mod crypto {
fn as_hex(data: ~[u8]) -> ~str {
let mut acc = ~"";
for data.each |byte| { acc += fmt!("%02x", byte as uint); }
for data.each |&byte| { acc += fmt!("%02x", byte as uint); }
return acc;
}
Expand All @@ -33,8 +33,8 @@ fn sha1(data: ~str) -> ~str unsafe {
return as_hex(vec::from_buf(hash, 20));
}
fn main(args: ~[~str]) {
io::println(sha1(args[1]));
fn main() {
io::println(sha1(core::os::args()[1]));
}
~~~~

Expand Down

0 comments on commit 0100b02

Please sign in to comment.