rust开发环境配置

环境

manjaro

sudo pacman -S rustup

rustup default stable
cargo install rustfmt

vscode

ext install rust-lang.rust-analyzer
ext install serayuzgur.crates
ext install tamasfe.even-better-toml

创建项目

cargo new xxx

调试模板

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "rust",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceRoot}/target/debug/${workspaceFolderBasename}",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${workspaceRoot}",
      "environment": [],
      "preLaunchTask": "build"
    }
  ]
}

tasks.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build",
      "type": "shell",
      "command": "cargo build"
    }
  ]
}
posted @   自由出土文物  阅读(61)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示