Group Module Imports

RUST-GROUP-MODULE-IMPORTS

Summary

Group related imports by module when that matches local style. This makes dependency shape easier to scan and avoids churn from one-import-per-line edits.

Rule

Prefer grouped module imports over one-import-per-line style.

Why

Grouped module imports keep related names together and make dependencies easier to scan. One-import-per-line style can exaggerate churn and hide that several imports come from the same conceptual module.

Helps

Helps readers see dependency shape by module and reduces churn from one-import-per-line edits.

Limits

Follow local convention when the crate intentionally uses single-item imports, especially where rustfmt or team style is already settled.

Agent Instruction

Prefer grouped module imports over one-import-per-line style because grouped module imports keep
related names together and make dependencies easier to scan.

Mechanisms

Group imports by source module, let rustfmt normalize ordering, and avoid expanding grouped imports unless doing so clarifies conflicting names or public re-exports.

References