• 欢迎光临~

rust开发环境配置

开发技术 开发技术 2022-12-21 次浏览

环境

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"
    }
  ]
}
程序员灯塔
转载请注明原文链接:rust开发环境配置
喜欢 (0)