]> git.lizzy.rs Git - rust.git/commitdiff
Remove old logging from the tutorial
authorAlex Crichton <alex@alexcrichton.com>
Tue, 22 Oct 2013 15:10:34 +0000 (08:10 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 22 Oct 2013 15:10:34 +0000 (08:10 -0700)
doc/rust.md
doc/tutorial-macros.md
doc/tutorial.md

index e17f8ed890b284753b69f0122b05fe8410addb33..2d4b0c15cb8342ebe7bb29235764d69e9df667d5 100644 (file)
@@ -700,15 +700,15 @@ mod math {
     type complex = (f64, f64);
     fn sin(f: f64) -> f64 {
         ...
-# fail2!();
+# fail!();
     }
     fn cos(f: f64) -> f64 {
         ...
-# fail2!();
+# fail!();
     }
     fn tan(f: f64) -> f64 {
         ...
-# fail2!();
+# fail!();
     }
 }
 ~~~~
@@ -1059,8 +1059,8 @@ output slot type would normally be. For example:
 
 ~~~~
 fn my_err(s: &str) -> ! {
-    info2!("{}", s);
-    fail2!();
+    info!("{}", s);
+    fail!();
 }
 ~~~~
 
@@ -1078,7 +1078,7 @@ were declared without the `!` annotation, the following code would not
 typecheck:
 
 ~~~~
-# fn my_err(s: &str) -> ! { fail2!() }
+# fn my_err(s: &str) -> ! { fail!() }
 
 fn f(i: int) -> int {
    if i == 42 {
@@ -2826,9 +2826,9 @@ enum List<X> { Nil, Cons(X, @List<X>) }
 let x: List<int> = Cons(10, @Cons(11, @Nil));
 
 match x {
-    Cons(_, @Nil) => fail2!("singleton list"),
+    Cons(_, @Nil) => fail!("singleton list"),
     Cons(*)       => return,
-    Nil           => fail2!("empty list")
+    Nil           => fail!("empty list")
 }
 ~~~~
 
@@ -2864,7 +2864,7 @@ match x {
         return;
     }
     _ => {
-        fail2!();
+        fail!();
     }
 }
 ~~~~
@@ -2918,7 +2918,7 @@ guard may refer to the variables bound within the pattern they follow.
 let message = match maybe_digit {
   Some(x) if x < 10 => process_digit(x),
   Some(x) => process_other(x),
-  None => fail2!()
+  None => fail!()
 };
 ~~~~
 
@@ -3669,10 +3669,10 @@ that demonstrates all four of them:
 
 ~~~~
 fn main() {
-    error2!("This is an error log")
-    warn2!("This is a warn log")
-    info2!("this is an info log")
-    debug2!("This is a debug log")
+    error!("This is an error log")
+    warn!("This is a warn log")
+    info!("this is an info log")
+    debug!("This is a debug log")
 }
 ~~~~
 
index a70b29f9100581fb219dfa56a286aced7827f2b0..f1f4ade0542d5068672ec76fa3486b2de02f3c52 100644 (file)
@@ -226,7 +226,7 @@ match x {
                 // complicated stuff goes here
                 return result + val;
             },
-            _ => fail2!("Didn't get good_2")
+            _ => fail!("Didn't get good_2")
         }
     }
     _ => return 0 // default value
@@ -268,7 +268,7 @@ macro_rules! biased_match (
 biased_match!((x)       ~ (good_1(g1, val)) else { return 0 };
               binds g1, val )
 biased_match!((g1.body) ~ (good_2(result) )
-                  else { fail2!("Didn't get good_2") };
+                  else { fail!("Didn't get good_2") };
               binds result )
 // complicated stuff goes here
 return result + val;
@@ -369,7 +369,7 @@ macro_rules! biased_match (
 # fn f(x: t1) -> uint {
 biased_match!(
     (x)       ~ (good_1(g1, val)) else { return 0 };
-    (g1.body) ~ (good_2(result) ) else { fail2!("Didn't get good_2") };
+    (g1.body) ~ (good_2(result) ) else { fail!("Didn't get good_2") };
     binds val, result )
 // complicated stuff goes here
 return result + val;
index 51a2e6eb38420c82e2f85425bd4188c3a1dfa0ae..42617a96daab380a7849d2a9dff9b43f3afde6c8 100644 (file)
@@ -763,7 +763,7 @@ unit, `()`, as the empty tuple if you like).
 ~~~~
 let mytup: (int, int, f64) = (10, 20, 30.0);
 match mytup {
-  (a, b, c) => info2!("{}", a + b + (c as int))
+  (a, b, c) => info!("{}", a + b + (c as int))
 }
 ~~~~
 
@@ -779,7 +779,7 @@ For example:
 struct MyTup(int, int, f64);
 let mytup: MyTup = MyTup(10, 20, 30.0);
 match mytup {
-  MyTup(a, b, c) => info2!("{}", a + b + (c as int))
+  MyTup(a, b, c) => info!("{}", a + b + (c as int))
 }
 ~~~~
 
@@ -1576,7 +1576,7 @@ arguments.
 use std::task::spawn;
 
 do spawn() || {
-    debug2!("I'm a task, whatever");
+    debug!("I'm a task, whatever");
 }
 ~~~~
 
@@ -1588,7 +1588,7 @@ may be omitted from `do` expressions.
 use std::task::spawn;
 
 do spawn {
-   debug2!("Kablam!");
+   debug!("Kablam!");
 }
 ~~~~