Created
November 6, 2014 15:55
-
-
Save aturon/bf84ef392ee6512aada3 to your computer and use it in GitHub Desktop.
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
fn nth(&mut self, mut n: uint) -> Option<A> { | |
for x in *self { | |
if n == 0 { return Some(x) } | |
n -= 1; | |
} | |
None | |
} | |
error: cannot borrow immutable local variable `self` as mutable | |
for x in *self { | |
^~~~~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment