diff options
| author | Caleb Cartwright <caleb.cartwright@outlook.com> | 2021-12-27 17:42:48 -0600 |
|---|---|---|
| committer | Caleb Cartwright <calebcartwright@users.noreply.github.com> | 2021-12-27 18:16:04 -0600 |
| commit | e8afb62c71f5c789c554e23c835efc019cb42685 (patch) | |
| tree | d6c5b9b682c7d0ebd1c57a7050868e14e60b32d6 | |
| parent | 76eb077fb298a01137c878a9f10854b44c5edf37 (diff) | |
| download | rust-e8afb62c71f5c789c554e23c835efc019cb42685.tar.gz rust-e8afb62c71f5c789c554e23c835efc019cb42685.zip | |
chore: reduce some vis. for updated unreachable_pub lint
| -rw-r--r-- | src/config/file_lines.rs | 8 | ||||
| -rw-r--r-- | src/config/options.rs | 14 | ||||
| -rw-r--r-- | src/rustfmt_diff.rs | 10 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/config/file_lines.rs b/src/config/file_lines.rs index 4b799780d85..7b498dc46b3 100644 --- a/src/config/file_lines.rs +++ b/src/config/file_lines.rs @@ -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() } } diff --git a/src/config/options.rs b/src/config/options.rs index bce9e5d07f2..d857c29be29 100644 --- a/src/config/options.rs +++ b/src/config/options.rs @@ -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 { diff --git a/src/rustfmt_diff.rs b/src/rustfmt_diff.rs index a394ce07398..1724a0f87bf 100644 --- a/src/rustfmt_diff.rs +++ b/src/rustfmt_diff.rs @@ -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 { |
