rust

Format and lint Rust code with cargo fmt and cargo clippy.

4|1|Updated Jul 23, 2020
One-click install
npx skills add https://github.com/onbjerg/dot --skill rust-onbjerg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust
Source: https://github.com/onbjerg/dot/tree/main/pi/skills/rust
Command: npx skills add https://github.com/onbjerg/dot --skill rust-onbjerg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers adhere to Rust best practices by providing formatting, linting, and safety comment conventions, reducing bugs and improving code consistency.

Core Features & Use Cases

  • Formatting Enforcement: Automatically format Rust code using cargo fmt.
  • Linting: Run cargo clippy to catch common mistakes and enforce coding standards.
  • Safety Comments: Guide developers on when and how to document safety assumptions around unwrap calls.
  • Use Case: A team reviews their Rust project to ensure code consistency and safety comments before code review or merging.

Quick Start

Use this skill to verify that your Rust project is properly formatted and free of lint warnings before committing changes.

Frequently Asked Questions about rust

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce Rust code formatting and linting in my project?

To enforce Rust code formatting and linting, you can run cargo fmt for style consistency and cargo clippy to catch common mistakes, ensuring source files comply with project conventions before merging.

Do I need cargo and rustup to perform Rust safety and linting checks?

Yes, you need cargo and rustup installed, as these tools are required to execute formatting, linting, and safety documentation checks across your Rust project files.

What is the best way to document safety assumptions around unwrap calls in Rust?

The best way to document safety assumptions around unwrap calls in Rust is to follow guided safety comment conventions, ensuring developers properly record when and why unwrapping is safe.

Can I use this to review Rust source files for project convention compliance before code review?

Yes, you can use this to review Rust source files, verifying that code is properly formatted, free of lint warnings, and compliant with safety comments before a team code review.

Why does my Rust code pass formatting but still fail linting checks?

Rust code can pass formatting but fail linting because cargo fmt only adjusts style, while cargo clippy analyzes logic to catch common mistakes and enforce deeper coding standards.