Skip to content

Conversation

steveklabnik
Copy link
Contributor

All these stars aren't needed anymore.

@@ -471,7 +471,7 @@ fn main() {
spawn(proc() {
let mut array = number.lock();

(*(*array).get_mut(i)) += 1;
*(array.get_mut(i)) += 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firstly, the parens aren't actually needed here, secondly (yay!) mutable indexing now works (works as well as immutable indexing, anyway, so the [] syntax can be used: (*array)[i] += 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sweet! I didn't try hard enough i guess :)

@huonw
Copy link
Contributor

huonw commented Oct 23, 2014

r=me with more square brackets. 😄

All these stars aren't needed anymore.
steveklabnik added a commit to steveklabnik/hello_rust that referenced this pull request Oct 23, 2014
bors added a commit that referenced this pull request Oct 23, 2014
@bors bors closed this Oct 23, 2014
@bors bors merged commit 4a74af6 into rust-lang:master Oct 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants