diff options
| author | Tim Joseph Dumol <tim@timdumol.com> | 2014-08-05 01:30:53 +0800 |
|---|---|---|
| committer | Tim Dumol <tim@timdumol.com> | 2014-08-05 02:02:41 +0800 |
| commit | a9979ada477c74be567f8df47ae8bd9a8b75f192 (patch) | |
| tree | 286d5c78f3f9ca97d8fb8fe69f7050f90f86fb97 | |
| parent | 31590bd34900403a18079bf4623cd35f9da0c100 (diff) | |
| download | rust-a9979ada477c74be567f8df47ae8bd9a8b75f192.tar.gz rust-a9979ada477c74be567f8df47ae8bd9a8b75f192.zip | |
doc: Fix the 30-minute intro to use += operator.
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 `+=`.
| -rw-r--r-- | src/doc/intro.md | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/doc/intro.md b/src/doc/intro.md index 128d5c9d320..6deaa50867b 100644 --- a/src/doc/intro.md +++ b/src/doc/intro.md @@ -359,10 +359,11 @@ fn main() { // Take the lock, along with exclusive access to the underlying array let mut numbers = numbers_lock.lock(); - // This is ugly for now, but will be replaced by - // `numbers[num as uint] += 1` in the near future. + // This is ugly for now because of the need for `get_mut`, but + // will be replaced by `numbers[num as uint] += 1` + // in the near future. // See: https://github.com/rust-lang/rust/issues/6515 - *numbers.get_mut(num as uint) = *numbers.get_mut(num as uint) + 1; + *numbers.get_mut(num as uint) += 1; println!("{}", (*numbers)[num as uint]); |
