We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ee1d3e commit 0100b02Copy full SHA for 0100b02
doc/tutorial-ffi.md
@@ -22,7 +22,7 @@ extern mod crypto {
22
23
fn as_hex(data: ~[u8]) -> ~str {
24
let mut acc = ~"";
25
- for data.each |byte| { acc += fmt!("%02x", byte as uint); }
+ for data.each |&byte| { acc += fmt!("%02x", byte as uint); }
26
return acc;
27
}
28
@@ -33,8 +33,8 @@ fn sha1(data: ~str) -> ~str unsafe {
33
return as_hex(vec::from_buf(hash, 20));
34
35
36
-fn main(args: ~[~str]) {
37
- io::println(sha1(args[1]));
+fn main() {
+ io::println(sha1(core::os::args()[1]));
38
39
~~~~
40
0 commit comments