chore: reduce some vis. for updated unreachable_pub lint

This commit is contained in:
Caleb Cartwright 2021-12-27 17:42:48 -06:00 committed by Caleb Cartwright
parent 76eb077fb2
commit e8afb62c71
3 changed files with 16 additions and 16 deletions

View File

@ -13,9 +13,9 @@ use thiserror::Error;
/// 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.
@ -75,7 +75,7 @@ impl Serialize for FileName {
}
impl LineRange {
pub fn file_name(&self) -> FileName {
pub(crate) fn file_name(&self) -> FileName {
self.file.name.clone().into()
}
}

View File

@ -218,24 +218,24 @@ pub enum Verbosity {
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 {

View File

@ -6,20 +6,20 @@ use std::io::Write;
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 {