format_rust

Apply clippy-aligned formatting rules to Rust code.

38|7|Updated May 3, 2026
One-click install
npx skills add https://github.com/theafh/ai-modules --skill format-rust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: format_rust
Source: https://github.com/theafh/ai-modules/tree/main/plugins/ai_dev/skills/format_rust
Command: npx skills add https://github.com/theafh/ai-modules --skill format-rust

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you write or edit Rust code so it conforms to clippy-aligned best practices, improving clarity, safety, and maintainability while reducing warning noise.

Core Features & Use Cases

  • Clippy-driven improvements: chooses the simplest correct Rust patterns that naturally satisfy clippy, turning warnings into actionable refinement.
  • Rust idioms for Results and Options: uses direct Result flow and idiomatic Option predicates like is_some_and to keep control flow clear.
  • Maintainable code structure: encourages small single-purpose functions, necessary imports only, borrow-scope clarity, and grouped function signatures via structs/config types.

Use case: You have a Rust module that builds but produces clippy warnings; apply this Skill to refactor it into idiomatic, warning-clean code with clearer data flow and safer string/borrowing behavior.

Quick Start

Ask the AI to apply the format_rust guidelines to the Rust file you’re editing and return a clippy-aligned revision.

Frequently Asked Questions about format_rust

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

FAQPage Schema
How do I fix clippy warnings in Rust code?

Fix clippy warnings by applying clippy-aligned formatting rules that refactor Rust code into idiomatic patterns, removing unused imports and improving borrowing clarity to reduce warning noise.

What are idiomatic ways to handle Results and Options in Rust?

Idiomatic Rust handles Results and Options using direct flow control and predicates like `is_some_and`, keeping control flow clear and satisfying clippy without unnecessary complexity.

How do I clean up Rust imports and borrowing scopes?

Clean up Rust imports and borrowing scopes by removing unused imports and clarifying borrow-scope boundaries, ensuring the code follows consistent best practices for safer data flow.

Does clippy-aligned formatting work with fallible builders and string handling?

Clippy-aligned formatting works with fallible builders and string handling by using project error types in builder APIs and preferring idiomatic standard-library helpers for string prefix and suffix operations.

What is the best way to group Rust function signatures?

The best way to group Rust function signatures is by using structs or config types, which maintains small single-purpose functions and ensures maintainable code structure.