【Rust】开发环境,Rust,Rustacean

Rust [rʌst] 生锈

Rustacean [rus'dation] 锈粉

【Rust】开发环境

使用 rustup 安装 rust

linux

$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

windows 安装

https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe

VS CODE 安装扩展

rust

crates

CODELLDB

Better TOML

更新

rustup update

卸载

rustup self uninstall

版本

rustc --version

Cargo 管理项目

Cargo 是 Rust 的构建系统和包管理器

cargo --version

Cargo.toml 配置文件

[package]
name = "hello_cargo"  #项目名称
version = "0.1.0"     #项目版本
edition = "2018"      #rust版本
  
[dependencies]        #项目依赖

创建项目

cargo new hello
cd hello

构建项目

cargo build

运行项目

cargo run

快速检查

cargo check
原文地址:https://www.cnblogs.com/yangchongxing/p/15550867.html