This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct TestData { | |
x: int | |
} | |
impl TestData { | |
pub fn addition(&mut self) { | |
self.x += 10; | |
} | |
} | |
// I would like to do something like this: | |
let v = ~[TestData{x: 1}]; | |
for data in v.iter() { | |
v.addition(); | |
} | |
// but iter does not seem to give mutable values. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment