@@ -859,8 +859,8 @@ fn main() {
859
859
log(info, Some(1.0));
860
860
861
861
// Equivalent to 'log(core::info,
862
- // core::str::to_upper(core::str::slice(~ "foo", 0u, 1u)));'
863
- log(info, to_upper(slice(~ "foo", 0u, 1u)));
862
+ // core::str::to_upper(core::str::slice("foo", 0u, 1u)));'
863
+ log(info, to_upper(slice("foo", 0u, 1u)));
864
864
}
865
865
~~~~
866
866
@@ -1050,14 +1050,14 @@ were declared without the `!` annotation, the following code would not
1050
1050
typecheck:
1051
1051
1052
1052
~~~~
1053
- # fn my_err(s: ~ str) -> ! { fail }
1053
+ # fn my_err(s: & str) -> ! { fail }
1054
1054
1055
1055
fn f(i: int) -> int {
1056
1056
if i == 42 {
1057
1057
return 42;
1058
1058
}
1059
1059
else {
1060
- my_err(~ "Bad number!");
1060
+ my_err("Bad number!");
1061
1061
}
1062
1062
}
1063
1063
~~~~
@@ -1502,7 +1502,7 @@ string, boolean value, or the nil value.
1502
1502
1503
1503
~~~~~~~~ {.literals}
1504
1504
(); // nil type
1505
- ~ "hello"; // string type
1505
+ "hello"; // string type
1506
1506
'5'; // character type
1507
1507
5; // integer type
1508
1508
~~~~~~~~
@@ -1520,7 +1520,7 @@ values.
1520
1520
1521
1521
~~~~~~~~ {.tuple}
1522
1522
(0f, 4.5f);
1523
- (~ "a", 4u, true);
1523
+ ("a", 4u, true);
1524
1524
~~~~~~~~
1525
1525
1526
1526
### Record expressions
@@ -1539,8 +1539,8 @@ written before its name.
1539
1539
1540
1540
~~~~
1541
1541
{x: 10f, y: 20f};
1542
- {name: ~ "Joe", age: 35u, score: 100_000};
1543
- {ident: ~ "X", mut count: 0u};
1542
+ {name: "Joe", age: 35u, score: 100_000};
1543
+ {ident: "X", mut count: 0u};
1544
1544
~~~~
1545
1545
1546
1546
The order of the fields in a record expression is significant, and
@@ -1609,7 +1609,7 @@ When no mutability is specified, the vector is immutable.
1609
1609
1610
1610
~~~~
1611
1611
~[1, 2, 3, 4];
1612
- ~[~ "a", ~ "b", ~ "c", ~ "d"];
1612
+ ~["a", "b", "c", "d"];
1613
1613
~[mut 0u8, 0u8, 0u8, 0u8];
1614
1614
~~~~
1615
1615
@@ -1633,7 +1633,7 @@ task in a _failing state_.
1633
1633
1634
1634
(~[1, 2, 3, 4])[0];
1635
1635
(~[mut 'x', 'y'])[1] = 'z';
1636
- (~[~ "a", ~ "b"])[10]; // fails
1636
+ (~["a", "b"])[10]; // fails
1637
1637
1638
1638
# }
1639
1639
~~~~
@@ -2034,7 +2034,7 @@ An example:
2034
2034
let mut i = 0;
2035
2035
2036
2036
while i < 10 {
2037
- io::println(~ "hello\n");
2037
+ io::println("hello\n");
2038
2038
i = i + 1;
2039
2039
}
2040
2040
~~~~
@@ -2281,9 +2281,9 @@ range of values may be specified with `..`. For example:
2281
2281
# let x = 2;
2282
2282
2283
2283
let message = match x {
2284
- 0 | 1 => ~ "not many",
2285
- 2 .. 9 => ~ "a few",
2286
- _ => ~ "lots"
2284
+ 0 | 1 => "not many",
2285
+ 2 .. 9 => "a few",
2286
+ _ => "lots"
2287
2287
};
2288
2288
~~~~
2289
2289
@@ -2366,7 +2366,7 @@ The following examples all produce the same output, logged at the `error`
2366
2366
logging level:
2367
2367
2368
2368
~~~~
2369
- # let filename = ~ "bulbasaur";
2369
+ # let filename = "bulbasaur";
2370
2370
2371
2371
// Full version, logging a value.
2372
2372
log(core::error, ~"file not found: " + filename);
0 commit comments