diff options
| author | Ruben Schmidmeister <ruben.schmidmeister@icloud.com> | 2019-05-09 20:37:51 +0200 |
|---|---|---|
| committer | Ruben Schmidmeister <ruben.schmidmeister@icloud.com> | 2019-05-09 20:37:51 +0200 |
| commit | 618d092bf722c15496235b45d1208178b8351c99 (patch) | |
| tree | cd83d03071a1f48d613f9a2d19d6a4d634092538 /src/rustfmt_diff.rs | |
| parent | a2264cb5497e7a35c781ec726954cde5dfd76efc (diff) | |
Enable unreachable_pub lint
Diffstat (limited to 'src/rustfmt_diff.rs')
| -rw-r--r-- | src/rustfmt_diff.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rustfmt_diff.rs b/src/rustfmt_diff.rs index c83eb1080a6..fd332b12403 100644 --- a/src/rustfmt_diff.rs +++ b/src/rustfmt_diff.rs @@ -146,14 +146,14 @@ impl std::str::FromStr for ModifiedLines { // This struct handles writing output to stdout and abstracts away the logic // of printing in color, if it's possible in the executing environment. -pub struct OutputWriter { +pub(crate) struct OutputWriter { terminal: Option<Box<dyn term::Terminal<Output = io::Stdout>>>, } impl OutputWriter { // Create a new OutputWriter instance based on the caller's preference // for colorized output and the capabilities of the terminal. - pub fn new(color: Color) -> Self { + pub(crate) fn new(color: Color) -> Self { if let Some(t) = term::stdout() { if color.use_colored_tty() && t.supports_color() { return OutputWriter { terminal: Some(t) }; @@ -165,7 +165,7 @@ impl OutputWriter { // Write output in the optionally specified color. The output is written // in the specified color if this OutputWriter instance contains a // Terminal in its `terminal` field. - pub fn writeln(&mut self, msg: &str, color: Option<term::color::Color>) { + pub(crate) fn writeln(&mut self, msg: &str, color: Option<term::color::Color>) { match &mut self.terminal { Some(ref mut t) => { if let Some(color) = color { @@ -182,7 +182,7 @@ impl OutputWriter { } // Produces a diff between the expected output and actual output of rustfmt. -pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec<Mismatch> { +pub(crate) fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec<Mismatch> { let mut line_number = 1; let mut line_number_orig = 1; let mut context_queue: VecDeque<&str> = VecDeque::with_capacity(context_size); @@ -250,7 +250,7 @@ pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec<Misma results } -pub fn print_diff<F>(diff: Vec<Mismatch>, get_section_title: F, config: &Config) +pub(crate) fn print_diff<F>(diff: Vec<Mismatch>, get_section_title: F, config: &Config) where F: Fn(u32) -> String, { |
