Created
January 7, 2022 12:14
-
-
Save rashaabdulrazzak/2193b2ef01b09a8d85708fd20952c7ed to your computer and use it in GitHub Desktop.
if let example
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
fn main() { | |
// define a scrutinee expression | |
let course = ("Rust", "course"); | |
// pattern matches with the scrutinee expression | |
if let ("Ja", "course") = course { | |
println!("Values matchecd"); | |
} else { | |
// do not execute this block | |
println!("Value unmatched"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment