Crate rustfmt_nightly
source ·Modules§
- attr πFormat attributes and meta items.
- chains πFormatting of chained expressions, i.e., expressions that are chained by dots: struct and enum field access, method calls, and try shorthand (
?
). - closures π
- comment π
- config π
- coverage π
- emitter π
- expr π
- formatting π
- ignore_
path π - imports π
- items π
- lists πFormat list-like expressions and items.
- macros π
- matches πFormat match expression.
- missed_
spans π - modules π
- overflow πRewrite a list some items with overflow.
- pairs π
- parse π
- patterns π
- release_
channel π - reorder πReorder items.
- rewrite π
- rustfmt_
diff π - shape π
- skip πModule that contains skip related stuffs.
- source_
file π - source_
map πThis module contains utilities that work with theSourceMap
fromlibsyntax
/syntex_syntax
. This includes extension traits and methods for looking up spans and line ranges for AST nodes. - spanned π
- stmt π
- string π
- types π
- utils π
- vertical π
- visitor π
Macros§
- Checks if weβre in a nightly build.
- static_
regex π - macro to help implement
StyleEditionDefault
for config options
Structs§
- A set of lines in files.
- Reports on any issues that occurred during a run of Rustfmt.
- Formats the warnings/errors in a
FormatReport
. - A builder for
FormatReportFormatter
. - Formatted
Snippet πResult of formatting a snippet of code along with ranges of lines that didnβt get formatted, i.e., that got returned as they were originally. - A single span of changed lines, with 0 or more removed lines and a vector of 0 or more inserted lines.
- Set of changed sections of a file.
- A range that is inclusive of both ends.
- A session is a run of rustfmt across a single or multiple inputs.
Enums§
- The various errors that can occur during formatting. Note that not all of these can currently be propagated to clients.
- Defines the name of an input - either a file or stdin.
Traits§
- Maps client-supplied options to Rustfmtβs internals, mostly overriding values in a config with values from the command line.
Functions§
- create_
emitter π - format_
code_ πblock Format the given code block. Mainly targeted for code block in comment. The code block may be incomplete (i.e., parser may be unable to parse it). To avoid panic in parser, we wrap the code block with a dummy function. The returned code block does not end with newline. - format_
snippet πFormat the given snippet. The snippet is expected to be complete code. When we cannot parse the given snippet, this function returnsNone
. - Loads a config by checking the client-supplied options and if appropriate, the file system (including searching the file system for overrides).