Skip to content

Commit f5ac411

Browse files
committedAug 5, 2014
auto merge of rust-lang#16247 : TimDumol/rust/patch-1, r=alexcrichton
The 30-minute intro had a comment mentioning that `+=` will be included in the future. It's already included, and this fixes it to use `+=`.
2 parents 6da3889 + a9979ad commit f5ac411

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/doc/intro.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,11 @@ fn main() {
359359
// Take the lock, along with exclusive access to the underlying array
360360
let mut numbers = numbers_lock.lock();
361361
362-
// This is ugly for now, but will be replaced by
363-
// `numbers[num as uint] += 1` in the near future.
362+
// This is ugly for now because of the need for `get_mut`, but
363+
// will be replaced by `numbers[num as uint] += 1`
364+
// in the near future.
364365
// See: https://github.com/rust-lang/rust/issues/6515
365-
*numbers.get_mut(num as uint) = *numbers.get_mut(num as uint) + 1;
366+
*numbers.get_mut(num as uint) += 1;
366367
367368
println!("{}", (*numbers)[num as uint]);
368369

0 commit comments

Comments
 (0)
Please sign in to comment.