From 2253d07341936c0671dee999f03779db72a1c712 Mon Sep 17 00:00:00 2001 From: Fahmi Akbar Wildana Date: Tue, 15 Oct 2019 08:25:53 +0700 Subject: [PATCH] Derive fmt::Debug whenever possible --- src/assets.rs | 1 + src/decorations.rs | 2 +- src/lib.rs | 2 +- src/line_range.rs | 4 ++-- src/output.rs | 1 + src/printer.rs | 2 +- src/style.rs | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/assets.rs b/src/assets.rs index 8b7cdb27..b757e4af 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -16,6 +16,7 @@ use crate::syntax_mapping::SyntaxMapping; pub const BAT_THEME_DEFAULT: &str = "Monokai Extended"; +#[derive(Debug)] pub struct HighlightingAssets { pub syntax_set: SyntaxSet, pub theme_set: ThemeSet, diff --git a/src/decorations.rs b/src/decorations.rs index 7654c617..787a847b 100644 --- a/src/decorations.rs +++ b/src/decorations.rs @@ -2,7 +2,7 @@ use crate::diff::LineChange; use crate::printer::{Colors, InteractivePrinter}; use ansi_term::Style; -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct DecorationText { pub width: usize, pub text: String, diff --git a/src/lib.rs b/src/lib.rs index 61956010..88db95d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,7 +76,7 @@ use line_range::LineRanges; use style::{OutputComponents, OutputWrap}; use syntax_mapping::SyntaxMapping; -#[derive(Clone, Default)] +#[derive(Debug, Clone, Default)] pub struct Config<'a> { /// List of files to print pub files: Vec>, diff --git a/src/line_range.rs b/src/line_range.rs index f28bf296..5f20c955 100644 --- a/src/line_range.rs +++ b/src/line_range.rs @@ -1,6 +1,6 @@ use crate::errors::*; -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct LineRange { pub lower: usize, pub upper: usize, @@ -89,7 +89,7 @@ pub enum RangeCheckResult { AfterLastRange, } -#[derive(Clone, Default)] +#[derive(Debug, Clone, Default)] pub struct LineRanges { ranges: Vec, largest_upper_bound: usize, diff --git a/src/output.rs b/src/output.rs index 43f79aee..8cf39118 100644 --- a/src/output.rs +++ b/src/output.rs @@ -9,6 +9,7 @@ use shell_words; use crate::errors::*; use crate::PagingMode; +#[derive(Debug)] pub enum OutputType { Pager(Child), Stdout(io::Stdout), diff --git a/src/printer.rs b/src/printer.rs index 3ad25169..14d5054a 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -567,7 +567,7 @@ impl<'a> Printer for InteractivePrinter<'a> { const DEFAULT_GUTTER_COLOR: u8 = 238; -#[derive(Default)] +#[derive(Debug, Default)] pub struct Colors { pub grid: Style, pub filename: Style, diff --git a/src/style.rs b/src/style.rs index 8ddd44e1..5a235008 100644 --- a/src/style.rs +++ b/src/style.rs @@ -72,7 +72,7 @@ impl FromStr for OutputComponent { } } -#[derive(Clone, Default)] +#[derive(Debug, Clone, Default)] pub struct OutputComponents(pub HashSet); impl OutputComponents {