]> git.lizzy.rs Git - rust.git/commitdiff
chore: reduce some vis. for updated unreachable_pub lint
authorCaleb Cartwright <caleb.cartwright@outlook.com>
Mon, 27 Dec 2021 23:42:48 +0000 (17:42 -0600)
committerCaleb Cartwright <calebcartwright@users.noreply.github.com>
Tue, 28 Dec 2021 00:16:04 +0000 (18:16 -0600)
src/config/file_lines.rs
src/config/options.rs
src/rustfmt_diff.rs

index 4b799780d85d964e528246b4fe934e9da527ee84..7b498dc46b320cd1444274cf17921fd5394326a9 100644 (file)
@@ -13,9 +13,9 @@
 
 /// 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 @@ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
 }
 
 impl LineRange {
-    pub fn file_name(&self) -> FileName {
+    pub(crate) fn file_name(&self) -> FileName {
         self.file.name.clone().into()
     }
 }
index bce9e5d07f267a67a8c39917609d4fa38cfbf115..d857c29be29c631bb42d3fd0c4439f8ae6fedaf9 100644 (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 {
index a394ce07398efe24a80eeeec494af32f297b3e17..1724a0f87bf7c48ffa114bcc77bf52b32e0dc20e 100644 (file)
@@ -6,20 +6,20 @@
 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 {