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 πŸ”’
format_report_formatter πŸ”’
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.
sort πŸ”’
source_file πŸ”’
source_map πŸ”’
This module contains utilities that work with the SourceMap from libsyntax/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Β§

config_option_with_style_edition_default
Defines unit structs to implement StyleEditionDefault for.
is_nightly_channel
Checks if we’re in a nightly build.
static_regex πŸ”’
style_edition_default
macro to help implement StyleEditionDefault for config options

StructsΒ§

Config
FileLines
A set of lines in files.
FormatReport
Reports on any issues that occurred during a run of Rustfmt.
FormatReportFormatter
Formats the warnings/errors in a FormatReport.
FormatReportFormatterBuilder
A builder for FormatReportFormatter.
FormattedSnippet πŸ”’
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.
ModifiedChunk
A single span of changed lines, with 0 or more removed lines and a vector of 0 or more inserted lines.
ModifiedLines
Set of changed sections of a file.
Range
A range that is inclusive of both ends.
Session
A session is a run of rustfmt across a single or multiple inputs.

EnumsΒ§

Color
Edition
EmitMode
ErrorKind
The various errors that can occur during formatting. Note that not all of these can currently be propagated to clients.
FileName
Defines the name of an input - either a file or stdin.
Input
NewlineStyle
StyleEdition
Verbosity
Version

TraitsΒ§

CliOptions
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 returns None.
load_config
Loads a config by checking the client-supplied options and if appropriate, the file system (including searching the file system for overrides).