Or the shorter: maybe_string.as_ref().map_or("none", String::as_str);. As of Rust 1.40, you can also use Option::as_deref .
確定! 回上一頁