从本教程:
如果没有else总是会导致()作为值.
为什么Rust强加了这个限制,并且不让一个if没有else返回其他值,如下所示:
if
else
let y = if x == 5 { 10 };
rust
rust ×1