Rust安装及学习资料

官网

包管理

Rust 程序设计语言

通过例子学 Rust

在线运行

安装rustup

echo 'export RUSTUP_DIST_SERVER=https://rsproxy.cn' >> ~/.bash_profile
echo 'export RUSTUP_UPDATE_ROOT=https://rsproxy.cn/rustup' >> ~/.bash_profile

echo 'export RUSTUP_DIST_SERVER=https://rsproxy.cn' >> ~/.zshrc
echo 'export RUSTUP_UPDATE_ROOT=https://rsproxy.cn/rustup' >> ~/.zshrc

# 环境变量生效
source ~/.bash_profile
source ~/.zshrc
# 删除已有的 rustup 安装
rustup self uninstall
# 安装 Rust 并使用飞书镜像
curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh
  • 安装完后重启终端再输入以下命令
# 验证 Rust 是否成功安装
rustc --version
# 验证 Cargo(Rust 的包管理工具)是否成功安装
cargo --version

升级Rust

rustup update

卸载Rust

rustup self uninstall

创建项目

# 包含 Rust 项目结构
cargo new demo
cd demo
# 编译并运行项目
cargo run

控制台输出:Hello, world!

本文作者:逢生博客

本文链接:https://www.cnblogs.com/wufengsheng/p/17752252.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   逢生博客  阅读(50)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 晚安 顏人中
  2. 2 出山 花粥 / 王胜娚
  3. 3 我们俩 郭顶
  4. 4 日落大道 梁博
  5. 5 像鱼 王贰浪
  6. 6 把回忆拼好给你 王贰浪
  7. 7 时光背面的我 刘至佳 / 韩瞳
  8. 8 愿你余生漫长 王贰浪
  9. 9 追寻你 王天戈 / 川青
  10. 10 夜空中最亮的星 逃跑计划
  11. 11 孤勇者 陈奕迅
  12. 12 不为谁而作的歌 林俊杰
  13. 13 消愁 毛不易
  14. 14 这一生关于你的风景 隔壁老樊
出山 - 花粥 / 王胜娚
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.