about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric J. Holmes <eric@ejholmes.net>2012-12-22 23:58:27 -0800
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-12-24 18:29:02 -0800
commit40a3e20bbbb5e4f61758cbe9668a7a968bb44e61 (patch)
tree4c56a75081dad5ed937c2ea2254deb66b03645ef
parentd30224a3d477752bf3ff9cfd889e8210a7066f62 (diff)
downloadrust-40a3e20bbbb5e4f61758cbe9668a7a968bb44e61.tar.gz
rust-40a3e20bbbb5e4f61758cbe9668a7a968bb44e61.zip
Fix example.
-rw-r--r--doc/tutorial-ffi.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/tutorial-ffi.md b/doc/tutorial-ffi.md
index 895aaf22436..8324f752c1d 100644
--- a/doc/tutorial-ffi.md
+++ b/doc/tutorial-ffi.md
@@ -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;
 }
 
@@ -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]));
 }
 ~~~~