... to an Option or Result in Rust? bool.then_some() does this: let my_bool = true; let my_option = my_bool.then_some(MyObject{}); let my_result ...
確定! 回上一頁