Skip to content

Instantly share code, notes, and snippets.

@ryanmr
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanmr/c3db69088c1e9f13eab4 to your computer and use it in GitHub Desktop.
Save ryanmr/c3db69088c1e9f13eab4 to your computer and use it in GitHub Desktop.

Here's a lovely error.

error: mismatched types: expected `wg::Value`, found `&wg::Value` (expected enum wg::Value, found &-ptr)

cards.push(Card::new(value.clone(), suit.clone()));

Solution

cards.push(Card::new(*value.clone(), *suit.clone()));

Oh, back to pointers already.

For the record, I've changed how this single line works at least three times since I wrote the original code in 0.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment