Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rustのweb開発を助ける 便利なツール紹介

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Rustのweb開発を助ける 便利なツール紹介

Rustの web開発がもっと楽になる、そんなツールの紹介です。

Avatar for Yuki Ishii

Yuki Ishii

July 16, 2024
Tweet

More Decks by Yuki Ishii

Other Decks in Programming

Transcript

  1. 自己紹介 - Yuki Ishii (いっしー) 開発: Web Development 経歴: ex-CyberAgent

    はこぶね便事務局 (現 ひとりエンジニア) 使用言語: Rust, Svelte X: @YukiIshii10 Blog: https://blog.yuki-dev.com/ 副業もしてます
  2. 紹介する ツール - cargo-clippy - cargo-fmt - cargo-machete - cargo-nextest

    - cargo-make - Cargo-audit - testcontainers-rs - VScode extension - crates
  3. cargo-clippy と cargo-fmt みんな大好き Rustの公式 Linter と Formatter. clippy は

    静的解析ツールで 未使用の変数や関数、Clippy Lintsというサイトで定義され ている文法の場合は warn または deny を教えてくれます。 Clippy Lints: https://rust-lang.github.io/rust-clippy/master/index.html fmt は公式の フォーマッターで style guidelines に基づいて 自動でフォーマットをかけ てくれます。
  4. cargo-fmt $ cargo fmt で 自動的にオートフォーマットをかけてくれます。 無駄な new line や

    スペースを消したり、見やすいように改行してくれます。 VS Code なら下記の設定を追加すると on save で自動で format をかけてくれます。
  5. cargo-nextest Rust の test runner です。 Features: - cargo test

    に比べて 2x - 3x 早いです (ベンチマーク参照) - cargo test より UI が綺麗です - Slow and leaky テストを検知してくれます - pre-built binaries 用意されてるので CI 導入が楽です - config が豊富 - Doctests がまだサポートされてません・・・
  6. cargo-make Rust の task runner です。機能がやたら豊富です。 Features: - Tasks, Dependencies,

    and Aliases - Commands, Scripts, and Sub Tasks - Conditions - Environment Variables - Other Programming Languages - etc…
  7. crates Cargo.toml ないの dependencies を管理するのに便利な機能を提供してます。 - Version 情報提供 - Commandで全ての

    dependencies のバージョンをアップデート - Crev (Rust の public code review) のリンク表示 - Doc.rs のリンク表示