Commit 34a4d7a201

Andrew Kelley <superjoe30@gmail.com>
2017-01-24 08:06:56
update cat example code
1 parent 4b3f18d
Changed files (1)
example
example/cat/main.zig
@@ -8,7 +8,7 @@ pub fn main(args: [][]u8) -> %void {
     for (args[1...]) |arg| {
         if (str.eql(arg, "-")) {
             catted_anything = true;
-            cat_stream(&io.stdin) %% |err| return err;
+            %return cat_stream(&io.stdin);
         } else if (arg[0] == '-') {
             return usage(exe);
         } else {
@@ -20,13 +20,13 @@ pub fn main(args: [][]u8) -> %void {
             defer %%is.close();
 
             catted_anything = true;
-            cat_stream(&is) %% |err| return err;
+            %return cat_stream(&is);
         }
     }
     if (!catted_anything) {
-        cat_stream(&io.stdin) %% |err| return err;
+        %return cat_stream(&io.stdin);
     }
-    io.stdout.flush() %% |err| return err;
+    %return io.stdout.flush();
 }
 
 fn usage(exe: []u8) -> %void {