[Beginner] - Struct Logic for Card Game

Hey, I hope you aren't too dispirited. The advice given is pretty sound. There's lots of help available here on the forums, as we can all see.

I think it's important to learn something to help yourself, you know "teach someone to fish, feed them for a lifetime" kind of deal :slight_smile:

So, a hopefully helpful lesson.

 --> src/main.rs:7:15
  |
7 |     deck.pop(), Some(3);
  |               ^ expected one of `.`, `;`, `?`, `}`, or an operator

Rust spits out this kind of error "expected one of..." quite frequently (at least it does for me!). You've got to read it, rust doesn't just guess some random characters, it lists the valid characters.

The obvious thing to do is check your syntax where this error points to (and in the enclosing function - look for mismatched brackets).

As a learning exercise, Why are each of the listed characters valid here? What would they do?
.
;
?
}

I won't answer my own question now, hopefully it helps to think about and try to answer.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.