Skip to content

Instantly share code, notes, and snippets.

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 bjorn3/e9956d455ea09ecf25a04dfbb3207e8e to your computer and use it in GitHub Desktop.
Save bjorn3/e9956d455ea09ecf25a04dfbb3207e8e to your computer and use it in GitHub Desktop.
loop {
for message in client.incoming_messages() {
match message.unwrap() {
OwnedMessage::Text(data) => data,
_ => None,
};
}
}
@gregsifr
Copy link

error[E0308]: match arms have incompatible types
  --> src/main.rs:67:17
   |
67 | /                 match message.unwrap() {
68 | |                     OwnedMessage::Text(data) => data,
69 | |                     _ => None,
70 | |                 };
   | |_________________^ expected struct `std::string::String`, found enum `std::option::Option`
   |
   = note: expected type `std::string::String`
              found type `std::option::Option<_>`

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