Skip to content

Instantly share code, notes, and snippets.

@DarinM223
Created November 25, 2016 07:10
Show Gist options
  • Save DarinM223/8f671d5488acd2e0803d024adf55bfc3 to your computer and use it in GitHub Desktop.
Save DarinM223/8f671d5488acd2e0803d024adf55bfc3 to your computer and use it in GitHub Desktop.
Rust errors
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