This commit is contained in:
2023-06-26 11:46:57 +02:00
parent 0116149495
commit f311fc4dd1
3 changed files with 23 additions and 0 deletions

8
iflet/Cargo.toml Normal file
View File

@@ -0,0 +1,8 @@
[package]
name = "iflet"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

14
iflet/src/main.rs Normal file
View File

@@ -0,0 +1,14 @@
fn main() {
let x = 1;
match x {
1 => println!("uno"),
_ => println!("no encontrado"),
}
if let 1 = x {
println!("uno")
} else {
println!("no encontrado")
}
}