官术网_书友最值得收藏!

Creating a variable

To create a new variable binding in Rust, we use the following form:

let x = 1; 

This means that we create a new variable binding called x whose content will be 1. The default type for numbers depends on the situation a bit, but usually it's a 32-bit signed integer. If we need a variable that can change, we use this form:

let mut x = 1; 

By default, all variables in Rust are non-mutable; therefore, we have to explicitly define a variable as being mutable.

主站蜘蛛池模板: 秀山| 浦县| 中江县| 漳平市| 浮梁县| 扎赉特旗| 万年县| 上虞市| 融水| 神农架林区| 大理市| 昭觉县| 兴业县| 公主岭市| 定结县| 泰和县| 长海县| 拉萨市| 南漳县| 灵台县| 磐石市| 灵川县| 突泉县| 岑溪市| 龙州县| 克东县| 新兴县| 宜兰县| 盐城市| 民县| 文昌市| 阳朔县| 邵东县| 乌审旗| 高青县| 抚州市| 利津县| 金华市| 阿合奇县| 清徐县| 临泉县|