Rust Formatter
Format Rust code with rustfmt-style indentation.Runs in this tab.⌘ ↵ runs it
Next step
AtriumKitFrom the team behind browserutils
Turn a click-through into an interactive demo
AtriumKit records your web app once in Chrome and turns every click into a step of a demo you can embed or share. There’s a free plan.
Try AtriumKit freeAbout Rust Formatter
Free online Rust formatter. Format Rust source code with 4-space indentation following rustfmt conventions for consistent, readable code. It runs in your browser. Nothing is sent to a server.
Questions
Does this follow rustfmt conventions?
Yes, the formatter uses 4-space indentation and same-line opening braces, following standard Rust formatting conventions.
Does it handle Rust-specific syntax?
Yes, the formatter handles impl blocks, trait definitions, match expressions, lifetime annotations, macros, and other Rust-specific constructs.
Can I format Rust code with macros like vec! and println!?
Yes, macro invocations are recognized and their contents are indented properly. Both function-like macros and declarative macro definitions are handled.
Does the Rust formatter work without installing the Rust toolchain?
Yes, this tool runs entirely in your browser. You do not need Rust, Cargo, or rustfmt installed to format Rust code here.
Comments
More in Formatters & Beautifiers
- HTML Formatter
- CSS Formatter
- JavaScript Formatter
- SQL Formatter
- XML Formatter
- Markdown Preview
- CSS Minifier
- HTML Minifier
Comments