Skip to main content Crate rustfmt_nightly Copy item path Source pub(crate) use crate::comment::LineClasses ; π pub(crate) use crate::emitter::Emitter ; π pub(crate) use crate::formatting::FormatErrorMap ; π pub(crate) use crate::formatting::FormattingError ; π pub(crate) use crate::formatting::ReportedErrors ; π pub(crate) use crate::formatting::SourceFile ; π pub(crate) use crate::modules::ModuleResolutionError ; π pub(crate) use crate::parse::parser::DirectoryOwnership ; π pub(crate) use crate::shape::Indent ; π pub(crate) use crate::utils::indent_next_line ; π pub use crate::config::CliOptions ;pub use crate::config::Color ;pub use crate::config::Config ;pub use crate::config::Edition ;pub use crate::config::EmitMode ;pub use crate::config::FileLines ;pub use crate::config::FileName ;pub use crate::config::NewlineStyle ;pub use crate::config::Range ;pub use crate::config::StyleEdition ;pub use crate::config::Verbosity ;pub use crate::config::Version ;pub use crate::config::load_config ;pub use crate::format_report_formatter::FormatReportFormatter ;pub use crate::format_report_formatter::FormatReportFormatterBuilder ;pub use crate::rustfmt_diff::ModifiedChunk ;pub use crate::rustfmt_diff::ModifiedLines ;pub(crate) use std::cell::RefCell ; π pub(crate) use std::cmp::min ; π pub(crate) use std::collections::HashMap ; π pub(crate) use std::fmt ; π pub(crate) use io ; π pub(crate) use Write ; π pub(crate) use std::mem ; π pub(crate) use std::panic ; π pub(crate) use std::panic ; π pub(crate) use std::path::PathBuf ; π pub(crate) use std::rc::Rc ; π pub(crate) use rustc_ast::ast; π pub(crate) use rustc_span::symbol; π pub(crate) use thiserror::Error; π 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 π header π headers are sets of consecutive keywords and tokens, such as
pub const unsafe fn foo and pub(crate) unsafe trait Bar. 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 π range π 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 π 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 FormatReport Reports on any issues that occurred during a run of Rustfmt. 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. Session A session is a run of rustfmt across a single or multiple inputs. ErrorKind The various errors that can occur during formatting. Note that not all of
these can currently be propagated to clients. Input 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.