Rust Rocket -- Hello World
使用 CLion 新建项目
目录路径 ~/rocket_hello_world
构建[1]
Rocket 只能使用 nightly 版本 进行编译。
Rocket makes abundant use of Rust's syntax extensions and other advanced, unstable features. Because of this, we'll need to use a nightly version of Rust
设置 Rust 编译器版本
全局设置
rustup default nightly
单个项目设置
rustup override set nightly
1 |
|
添加依赖到 Cargo.toml
1 |
|
源码
main.rs
1 |
|
运行
cargo run
- https://rocket.rs/v0.4/guide/getting-started/ ↩︎
Rust Rocket -- Hello World
http://blog.soul11201.com/2020/09/30/rocket-hello-world/