Created
May 22, 2016 17:38
-
-
Save jimmycuadra/4182662903ea842bf6745035143414d4 to your computer and use it in GitHub Desktop.
Tuple pattern match in for loop
This file contains 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
src/lib.rs:210:17: 210:36 error: mismatched types [E0308] | |
src/lib.rs:210 for (field_name, field) in &numbers_to_check { | |
^~~~~~~~~~~~~~~~~~~ | |
src/lib.rs:210:17: 210:36 help: run `rustc --explain E0308` to see a detailed explanation | |
src/lib.rs:210:17: 210:36 note: expected type `&(&str, std::option::Option<tests::PhoneNumber>)` | |
src/lib.rs:210:17: 210:36 note: found type `(_, _)` |
This file contains 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
let numbers_to_check = [ | |
("home_number", self.home_number), | |
("cell_number", self.cell_number), | |
]; | |
for (field_name, field) in &numbers_to_check { | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment