if表达式的条件必须是bool类型
在if表达式中与条件相关的
fn main() {
let _x = true;
let _y = if _x { 5 } else { 6 };
println!("_y = {}", _y);
}
代码块就叫做分支arm
















https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。