DAILY DOCDAILY DOC
Rust
Node
Notes
Ubuntu
Leetcode
  • it-tools
  • excalidraw
  • linux-command
Rust
Node
Notes
Ubuntu
Leetcode
  • it-tools
  • excalidraw
  • linux-command
  • rust

    • Rust
    • add
    • 属性(attributes)
    • cargo issue
    • cli
    • build.rs
    • Enums
    • eventEmitter(rust)
    • 格式化输出 std::fmt
    • rust iterator
    • rust 学习计划
    • 生命周期(lifetime)
    • Linked List
    • log
    • macros
    • mem::size_of
    • niche optimization
    • Rust 所有权
    • 模式匹配(pattern matching)
    • module system
    • result & option
    • .rust-analyzer.json
    • rust startup
    • rust-test
    • 可见性(visibility)
    • cargo
    • toml

rust startup

安装

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

# update path
source $HOME/.cargo/env

# update rust
rustup update

# 安装 clippy
rustup component add clippy
# run clippy
cargo clippy --fix 

vscode 开发配置

.vscode/settings.json 配置
 {
  "editor.tabSize": 4,
  "editor.inlayHints.enabled": "off",
  "editor.formatOnSave": true,
  "rust-analyzer.files.excludeDirs": [".vscode/", "target/"],
  "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
  "[rust]": { "editor.defaultFormatter": "rust-lang.rust-analyzer" },
  "rust-analyzer.checkOnSave.command": "clippy",
  "debug.allowBreakpointsEverywhere": true,
  "editor.codeActionsOnSave": { "source.fixAll": true, "source.organizeImports": true }
}

rust-analyzer 插件

Refer

  • vscode rust
  • rust-analyzer
Last Updated:
Contributors: rosendo
Prev
.rust-analyzer.json
Next
rust-test