Created
November 25, 2016 07:10
-
-
Save DarinM223/8f671d5488acd2e0803d024adf55bfc3 to your computer and use it in GitHub Desktop.
Rust errors
This file contains hidden or 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
| error: cannot borrow immutable local variable `deck` as mutable | |
| --> src/main.rs:45:17 | |
| | | |
| 44 | let deck = Deck::new(); | |
| | ---- use `mut deck` here to make mutable | |
| 45 | let card1 = deck.take().unwrap(); | |
| | ^^^^ cannot borrow mutably | |
| error: cannot borrow immutable local variable `deck` as mutable | |
| --> src/main.rs:46:17 | |
| | | |
| 44 | let deck = Deck::new(); | |
| | ---- use `mut deck` here to make mutable | |
| 45 | let card1 = deck.take().unwrap(); | |
| 46 | let card2 = deck.take().unwrap(); | |
| | ^^^^ cannot borrow mutably | |
| error: cannot borrow immutable local variable `deck` as mutable | |
| --> src/main.rs:47:5 | |
| | | |
| 44 | let deck = Deck::new(); | |
| | ---- use `mut deck` here to make mutable | |
| ... | |
| 47 | deck.shuffle(); | |
| | ^^^^ cannot borrow mutably | |
| error: aborting due to 3 previous errors | |
| error: Could not compile `deck`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment