Skip to content

Commit 3ed18bd

Browse files
committed
Remove old logging from the tutorial
1 parent 7aa32f7 commit 3ed18bd

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

doc/rust.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -700,15 +700,15 @@ mod math {
700700
type complex = (f64, f64);
701701
fn sin(f: f64) -> f64 {
702702
...
703-
# fail2!();
703+
# fail!();
704704
}
705705
fn cos(f: f64) -> f64 {
706706
...
707-
# fail2!();
707+
# fail!();
708708
}
709709
fn tan(f: f64) -> f64 {
710710
...
711-
# fail2!();
711+
# fail!();
712712
}
713713
}
714714
~~~~
@@ -1059,8 +1059,8 @@ output slot type would normally be. For example:
10591059

10601060
~~~~
10611061
fn my_err(s: &str) -> ! {
1062-
info2!("{}", s);
1063-
fail2!();
1062+
info!("{}", s);
1063+
fail!();
10641064
}
10651065
~~~~
10661066

@@ -1078,7 +1078,7 @@ were declared without the `!` annotation, the following code would not
10781078
typecheck:
10791079

10801080
~~~~
1081-
# fn my_err(s: &str) -> ! { fail2!() }
1081+
# fn my_err(s: &str) -> ! { fail!() }
10821082
10831083
fn f(i: int) -> int {
10841084
if i == 42 {
@@ -2826,9 +2826,9 @@ enum List<X> { Nil, Cons(X, @List<X>) }
28262826
let x: List<int> = Cons(10, @Cons(11, @Nil));
28272827
28282828
match x {
2829-
Cons(_, @Nil) => fail2!("singleton list"),
2829+
Cons(_, @Nil) => fail!("singleton list"),
28302830
Cons(*) => return,
2831-
Nil => fail2!("empty list")
2831+
Nil => fail!("empty list")
28322832
}
28332833
~~~~
28342834

@@ -2864,7 +2864,7 @@ match x {
28642864
return;
28652865
}
28662866
_ => {
2867-
fail2!();
2867+
fail!();
28682868
}
28692869
}
28702870
~~~~
@@ -2918,7 +2918,7 @@ guard may refer to the variables bound within the pattern they follow.
29182918
let message = match maybe_digit {
29192919
Some(x) if x < 10 => process_digit(x),
29202920
Some(x) => process_other(x),
2921-
None => fail2!()
2921+
None => fail!()
29222922
};
29232923
~~~~
29242924

@@ -3669,10 +3669,10 @@ that demonstrates all four of them:
36693669

36703670
~~~~
36713671
fn main() {
3672-
error2!("This is an error log")
3673-
warn2!("This is a warn log")
3674-
info2!("this is an info log")
3675-
debug2!("This is a debug log")
3672+
error!("This is an error log")
3673+
warn!("This is a warn log")
3674+
info!("this is an info log")
3675+
debug!("This is a debug log")
36763676
}
36773677
~~~~
36783678

doc/tutorial-macros.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ match x {
226226
// complicated stuff goes here
227227
return result + val;
228228
},
229-
_ => fail2!("Didn't get good_2")
229+
_ => fail!("Didn't get good_2")
230230
}
231231
}
232232
_ => return 0 // default value
@@ -268,7 +268,7 @@ macro_rules! biased_match (
268268
biased_match!((x) ~ (good_1(g1, val)) else { return 0 };
269269
binds g1, val )
270270
biased_match!((g1.body) ~ (good_2(result) )
271-
else { fail2!("Didn't get good_2") };
271+
else { fail!("Didn't get good_2") };
272272
binds result )
273273
// complicated stuff goes here
274274
return result + val;
@@ -369,7 +369,7 @@ macro_rules! biased_match (
369369
# fn f(x: t1) -> uint {
370370
biased_match!(
371371
(x) ~ (good_1(g1, val)) else { return 0 };
372-
(g1.body) ~ (good_2(result) ) else { fail2!("Didn't get good_2") };
372+
(g1.body) ~ (good_2(result) ) else { fail!("Didn't get good_2") };
373373
binds val, result )
374374
// complicated stuff goes here
375375
return result + val;

doc/tutorial.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ unit, `()`, as the empty tuple if you like).
763763
~~~~
764764
let mytup: (int, int, f64) = (10, 20, 30.0);
765765
match mytup {
766-
(a, b, c) => info2!("{}", a + b + (c as int))
766+
(a, b, c) => info!("{}", a + b + (c as int))
767767
}
768768
~~~~
769769

@@ -779,7 +779,7 @@ For example:
779779
struct MyTup(int, int, f64);
780780
let mytup: MyTup = MyTup(10, 20, 30.0);
781781
match mytup {
782-
MyTup(a, b, c) => info2!("{}", a + b + (c as int))
782+
MyTup(a, b, c) => info!("{}", a + b + (c as int))
783783
}
784784
~~~~
785785

@@ -1576,7 +1576,7 @@ arguments.
15761576
use std::task::spawn;
15771577
15781578
do spawn() || {
1579-
debug2!("I'm a task, whatever");
1579+
debug!("I'm a task, whatever");
15801580
}
15811581
~~~~
15821582

@@ -1588,7 +1588,7 @@ may be omitted from `do` expressions.
15881588
use std::task::spawn;
15891589
15901590
do spawn {
1591-
debug2!("Kablam!");
1591+
debug!("Kablam!");
15921592
}
15931593
~~~~
15941594

0 commit comments

Comments
 (0)