小编Aur*_*ult的帖子

Rust OR between two options

I want to know if its possible to perform an OR operation between two Options. Something like :

let a = Some(3);
let b = None;
let result = a || b;
Run Code Online (Sandbox Code Playgroud)

Here I want the result variable to have either the value of a if it's a Some or the value of b.

I didn't find any documentation of this on Internet.

operators rust

0
推荐指数
1
解决办法
375
查看次数

标签 统计

operators ×1

rust ×1