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

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.

主站蜘蛛池模板: 仙桃市| 夏河县| 龙游县| 宜川县| 济源市| 凤凰县| 彝良县| 修武县| 鄯善县| 墨脱县| 漠河县| 临泽县| 平南县| 淮阳县| 亚东县| 凤凰县| 南陵县| 工布江达县| 娱乐| 金华市| 德清县| 肃宁县| 手游| 嘉兴市| 皮山县| 进贤县| 沁水县| 垣曲县| 正阳县| 公主岭市| 漾濞| 杭锦旗| 鹤壁市| 微博| 剑河县| 忻州市| 甘孜县| 商丘市| 通榆县| 邹城市| 辽宁省|