Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rustのweb開発を助ける 便利なツール紹介
Search
Yuki Ishii
July 16, 2024
Programming
1
460
Rustのweb開発を助ける 便利なツール紹介
Rustの web開発がもっと楽になる、そんなツールの紹介です。
Yuki Ishii
July 16, 2024
Tweet
Share
More Decks by Yuki Ishii
See All by Yuki Ishii
Server側でStateを使用した時の情報漏洩の危険性を見てみる
yuki0418
1
110
Other Decks in Programming
See All in Programming
A full stack side project webapp all in Kotlin (KotlinConf 2025)
dankim
0
120
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
2
19k
iOS 26にアップデートすると実機でのHot Reloadができない?
umigishiaoi
0
130
Node-RED を(HTTP で)つなげる MCP サーバーを作ってみた
highu
0
120
レベル1の開発生産性向上に取り組む − 日々の作業の効率化・自動化を通じた改善活動
kesoji
0
240
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
3
780
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
2.2k
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
93
31k
10 Costly Database Performance Mistakes (And How To Fix Them)
andyatkinson
0
440
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
400
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
16
12k
GPUを計算資源として使おう!
primenumber
1
170
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Thoughts on Productivity
jonyablonski
69
4.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Bash Introduction
62gerente
613
210k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
GraphQLとの向き合い方2022年版
quramy
49
14k
Practical Orchestrator
shlominoach
189
11k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Visualization
eitanlees
146
16k
Transcript
Rustのweb開発を助ける 便利なツール紹介 Yuki Ishii (いっしー)
自己紹介 - Yuki Ishii (いっしー) 開発: Web Development 経歴: ex-CyberAgent
はこぶね便事務局 (現 ひとりエンジニア) 使用言語: Rust, Svelte X: @YukiIshii10 Blog: https://blog.yuki-dev.com/ 副業もしてます
Summary 目的: 少しでも Rust でのWeb開発を楽しくなるように ターゲット : Rustで開発をしている人・はじめようとしてる人 今回は簡単な紹介になります。 どれも素敵なツールなので深い機能などは是非調べてみてください!
紹介する ツール - cargo-clippy - cargo-fmt - cargo-machete - cargo-nextest
- cargo-make - Cargo-audit - testcontainers-rs - VScode extension - crates
cargo-clippy cargo-fmt
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 に基づいて 自動でフォーマットをかけ てくれます。
cargo-clippy 円周率などの数学定数を扱った場合 $ cargo clippy をすると下記のように表示されます。
cargo-clippy 今回の円周率の場合は PI というconstant が用意されているのでそちらを使うように教 えてくれたので変更。
cargo-fmt $ cargo fmt で 自動的にオートフォーマットをかけてくれます。 無駄な new line や
スペースを消したり、見やすいように改行してくれます。 VS Code なら下記の設定を追加すると on save で自動で format をかけてくれます。
cargo-machete
cargo-machete 未使用の dependencies を教えてくれます。 例では serde を使ってない事を教えてくれました。
cargo-machete Actionが用意されてるので主に マージ前にチェックしてます。
cargo-nextest
cargo-nextest Rust の test runner です。 Features: - cargo test
に比べて 2x - 3x 早いです (ベンチマーク参照) - cargo test より UI が綺麗です - Slow and leaky テストを検知してくれます - pre-built binaries 用意されてるので CI 導入が楽です - config が豊富 - Doctests がまだサポートされてません・・・
cargo-nextest cargo test cargo nextest
cargo-make
cargo-make Rust の task runner です。機能がやたら豊富です。 Features: - Tasks, Dependencies,
and Aliases - Commands, Scripts, and Sub Tasks - Conditions - Environment Variables - Other Programming Languages - etc…
cargo-make Makefile.toml
cargo-make 他の言語もインストールしてなくても Script で実行できました。
cargo-audit
cargo-audit 脆弱性がある dependencies を教えてくれます。 RustSec Advisory Database という `rustsec/advisory-db` のレポジトリーにレポートが
あった Advisories を元に検知してます。 Dependabot みたいな感じです。
cargo-audit 例) libflate という crate の脆弱性
testcontainers-rs
testcontainers-rs テスト環境に必要な外部ツールなどをコンテナとして用意してくれます。これによって 外 部接続のモジュールなどをモックしたり、Dockerを用意する必要がなく、簡単にテストが 行うことができます。 また作成されたコンテナはスコープが外れたら自動的に削除されます。 例として redis を必要としてるアプリケーションのテスト時にコードから redis
server を動 かしてるコンテナを起動します。
testcontainers-rs 例) redis v7.2.4 をテスト時だけ起動する。(port 60874は自動的割り当て)
testcontainers-rs Community メンテされている testcontainers-modules を使用すればいろんな Image が module として提供されてます。
VScode extension crates
crates Cargo.toml ないの dependencies を管理するのに便利な機能を提供してます。 - Version 情報提供 - Commandで全ての
dependencies のバージョンをアップデート - Crev (Rust の public code review) のリンク表示 - Doc.rs のリンク表示
crates - Cargo.toml を開くと バージョンが 古い場合は 視覚的に教えてくれま す。 - 有効なバージョン一覧を表示してく
れます。 - crate.io, doc.rs, Crev(Check Reviews)のリンクを表示してくれま す。
crates Command で Cargo.toml ないの dependencies を update してくれます。 (あんまり使ってないかも)
eof Thank you @YukiIshii10