Rust安装及学习资料
官网
包管理
Rust 程序设计语言
通过例子学 Rust
在线运行
安装rustup
- 飞书镜像:https://rsproxy.cn/
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 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步