/// A range of lines in a file, inclusive of both ends.
pub struct LineRange {
- pub file: Lrc<SourceFile>,
- pub lo: usize,
- pub hi: usize,
+ pub(crate) file: Lrc<SourceFile>,
+ pub(crate) lo: usize,
+ pub(crate) hi: usize,
}
/// Defines the name of an input - either a file or stdin.
}
impl LineRange {
- pub fn file_name(&self) -> FileName {
+ pub(crate) fn file_name(&self) -> FileName {
self.file.name.clone().into()
}
}
pub struct WidthHeuristics {
// Maximum width of the args of a function call before falling back
// to vertical formatting.
- pub fn_call_width: usize,
+ pub(crate) fn_call_width: usize,
// Maximum width of the args of a function-like attributes before falling
// back to vertical formatting.
- pub attr_fn_like_width: usize,
+ pub(crate) attr_fn_like_width: usize,
// Maximum width in the body of a struct lit before falling back to
// vertical formatting.
- pub struct_lit_width: usize,
+ pub(crate) struct_lit_width: usize,
// Maximum width in the body of a struct variant before falling back
// to vertical formatting.
- pub struct_variant_width: usize,
+ pub(crate) struct_variant_width: usize,
// Maximum width of an array literal before falling back to vertical
// formatting.
- pub array_width: usize,
+ pub(crate) array_width: usize,
// Maximum length of a chain to fit on a single line.
- pub chain_width: usize,
+ pub(crate) chain_width: usize,
// Maximum line length for single line if-else expressions. A value
// of zero means always break if-else expressions.
- pub single_line_if_else_max_width: usize,
+ pub(crate) single_line_if_else_max_width: usize,
}
impl fmt::Display for WidthHeuristics {
use crate::config::{Color, Config, Verbosity};
#[derive(Debug, PartialEq)]
-pub enum DiffLine {
+pub(crate) enum DiffLine {
Context(String),
Expected(String),
Resulting(String),
}
#[derive(Debug, PartialEq)]
-pub struct Mismatch {
+pub(crate) struct Mismatch {
/// The line number in the formatted version.
- pub line_number: u32,
+ pub(crate) line_number: u32,
/// The line number in the original version.
- pub line_number_orig: u32,
+ pub(crate) line_number_orig: u32,
/// The set of lines (context and old/new) in the mismatch.
- pub lines: Vec<DiffLine>,
+ pub(crate) lines: Vec<DiffLine>,
}
impl Mismatch {