Skip to content

Commit 80c4f74

Browse files
committed
Remove the 'to' keyword
1 parent d777e51 commit 80c4f74

File tree

13 files changed

+2418
-2419
lines changed

13 files changed

+2418
-2419
lines changed

doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,14 +2211,14 @@ fn main() {
22112211
~~~~
22122212

22132213
Multiple match patterns may be joined with the `|` operator. A
2214-
range of values may be specified with `to`. For example:
2214+
range of values may be specified with `..`. For example:
22152215

22162216
~~~~
22172217
# let x = 2;
22182218
22192219
let message = match x {
22202220
0 | 1 => ~"not many",
2221-
2 to 9 => ~"a few",
2221+
2 .. 9 => ~"a few",
22222222
_ => ~"lots"
22232223
};
22242224
~~~~

src/libcore/char.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ pure fn is_digit(c: char) -> bool {
120120
*/
121121
pure fn to_digit(c: char, radix: uint) -> Option<uint> {
122122
let val = match c {
123-
'0' to '9' => c as uint - ('0' as uint),
124-
'a' to 'z' => c as uint + 10u - ('a' as uint),
125-
'A' to 'Z' => c as uint + 10u - ('A' as uint),
123+
'0' .. '9' => c as uint - ('0' as uint),
124+
'a' .. 'z' => c as uint + 10u - ('a' as uint),
125+
'A' .. 'Z' => c as uint + 10u - ('A' as uint),
126126
_ => return None
127127
};
128128
if val < radix { Some(val) }
@@ -171,7 +171,7 @@ fn escape_default(c: char) -> ~str {
171171
'\\' => ~"\\\\",
172172
'\'' => ~"\\'",
173173
'"' => ~"\\\"",
174-
'\x20' to '\x7e' => str::from_char(c),
174+
'\x20' .. '\x7e' => str::from_char(c),
175175
_ => escape_unicode(c)
176176
}
177177
}

src/libcore/float.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ fn from_str(num: &str) -> Option<float> {
263263

264264
//The string must start with one of the following characters.
265265
match str::char_at(num, 0u) {
266-
'-' | '+' | '0' to '9' | '.' => (),
266+
'-' | '+' | '0' .. '9' | '.' => (),
267267
_ => return None
268268
}
269269

@@ -286,7 +286,7 @@ fn from_str(num: &str) -> Option<float> {
286286
c = char_range.ch;
287287
pos = char_range.next;
288288
match c {
289-
'0' to '9' => {
289+
'0' .. '9' => {
290290
total = total * 10f;
291291
total += ((c as int) - ('0' as int)) as float;
292292
}

0 commit comments

Comments
 (0)