Let binding with "|"
⚓ Rust 📅 2025-06-05 👤 surdeus 👁️ 11Why I can not write a code like this:
fn main() {
let a = None;
let b = Some(1);
if let Some(c) = a | b {
dbg!(c);
}
}
I want to match the first one of a and b that can match successfully.
I think this is a natural idea for newbie.
8 posts - 4 participants
🏷️ rust_feed