kuikuitage

  博客园  ::  :: 新随笔  :: 联系 ::  :: 管理

2020年8月1日

摘要: 变量和可变性 Rust变量默认是不可改变的(immutable),一旦值被绑定一个名称上,你就不能改变这个值 let x = 5; x = 6; 报错cannot assign twice to immutable variable 对不可变变量 x 赋第二个值,如果想要重新赋值,可以这样做: le 阅读全文
posted @ 2020-08-01 19:26 kuikuitage 阅读(162) 评论(0) 推荐(0) 编辑

摘要: use std::io; fn main() { println!("Guess the number!"); println!("Please input your guess."); let mut guess = String::new(); io::stdin().read_line(&mu 阅读全文
posted @ 2020-08-01 18:14 kuikuitage 阅读(144) 评论(0) 推荐(0) 编辑

摘要: 1.安装 在线安装: $ curl https://sh.rustup.rs -sSf | sh 离线安装 Other ways to install rustup 2.配置环境 $ source $HOME/.cargo/env 或者可以在~/.bash_profile 或者 ~/.bashrc最 阅读全文
posted @ 2020-08-01 17:22 kuikuitage 阅读(527) 评论(0) 推荐(0) 编辑