Skip to content

Commit 8c34b26

Browse files
committed
Update docs by dropping suffixes except where they served to instruct.
1 parent 1f4ee20 commit 8c34b26

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

src/doc/intro.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ use std::sync::{Arc,Mutex};
480480
fn main() {
481481
let numbers = Arc::new(Mutex::new(vec![1, 2, 3]));
482482
483-
for i in 0us..3 {
483+
for i in 0..3 {
484484
let number = numbers.clone();
485485
Thread::spawn(move || {
486486
let mut array = number.lock().unwrap();
@@ -541,7 +541,7 @@ use std::thread::Thread;
541541
fn main() {
542542
let vec = vec![1, 2, 3];
543543
544-
for i in 0us..3 {
544+
for i in 0..3 {
545545
Thread::spawn(move || {
546546
println!("{}", vec[i]);
547547
});

src/doc/reference.md

+8-12
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,9 @@ An _integer literal_ has one of four forms:
465465

466466
Like any literal, an integer literal may be followed (immediately,
467467
without any spaces) by an _integer suffix_, which forcibly sets the
468-
type of the literal. There are 10 valid values for an integer suffix:
469-
470-
* Each of the signed and unsigned machine types `u8`, `i8`,
471-
`u16`, `i16`, `u32`, `i32`, `u64` and `i64`
472-
give the literal the corresponding machine type.
473-
* The `is` and `us` suffixes give the literal type `isize` or `usize`,
474-
respectively.
468+
type of the literal. The integer suffix must be the name of one of the
469+
integral types: `u8`, `i8`, `u16`, `i16`, `u32`, `i32`, `u64`, `i64`,
470+
`isize`, or `usize`.
475471

476472
The type of an _unsuffixed_ integer literal is determined by type inference.
477473
If an integer type can be _uniquely_ determined from the surrounding program
@@ -489,7 +485,7 @@ Examples of integer literals of various forms:
489485
0xff_u8; // type u8
490486
0o70_i16; // type i16
491487
0b1111_1111_1001_0000_i32; // type i32
492-
0us; // type usize
488+
0usize; // type usize
493489
```
494490

495491
##### Floating-point literals
@@ -1001,8 +997,8 @@ fn foo<T>(_: T){}
1001997
fn bar(map1: HashMap<String, usize>, map2: hash_map::HashMap<String, usize>){}
1002998
1003999
fn main() {
1004-
// Equivalent to 'std::iter::range_step(0us, 10, 2);'
1005-
range_step(0us, 10, 2);
1000+
// Equivalent to 'std::iter::range_step(0, 10, 2);'
1001+
range_step(0, 10, 2);
10061002
10071003
// Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
10081004
// std::option::Option::None]);'
@@ -3126,7 +3122,7 @@ conditional expression evaluates to `false`, the `while` expression completes.
31263122
An example:
31273123

31283124
```
3129-
let mut i = 0us;
3125+
let mut i = 0;
31303126
31313127
while i < 10 {
31323128
println!("hello");
@@ -3206,7 +3202,7 @@ An example of a for loop over a series of integers:
32063202

32073203
```
32083204
# fn bar(b:usize) { }
3209-
for i in 0us..256 {
3205+
for i in 0..256 {
32103206
bar(i);
32113207
}
32123208
```

src/doc/trpl/concurrency.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ use std::time::Duration;
244244
fn main() {
245245
let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
246246
247-
for i in 0us..2 {
247+
for i in 0..2 {
248248
let data = data.clone();
249249
thread::spawn(move || {
250250
let mut data = data.lock().unwrap();
@@ -267,7 +267,7 @@ thread more closely:
267267
# use std::time::Duration;
268268
# fn main() {
269269
# let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
270-
# for i in 0us..2 {
270+
# for i in 0..2 {
271271
# let data = data.clone();
272272
thread::spawn(move || {
273273
let mut data = data.lock().unwrap();

0 commit comments

Comments
 (0)