0001以下、5ちゃんねるからVIPがお送りします
2022/03/13(日) 14:34:36.984ID:Z7h7RzU40match文で書く
match x {
Some(a) => println!("is some"),
None => println!("is none")
}
if let文で書く
if let Some(a) = x {
println!("is some");
} esle {
println!("otherwise");
}
メソッドを使う
if x.is_some() {
println!("is some");
}