From 2645a116d1b9093bf945f97c6945ea771d17765e Mon Sep 17 00:00:00 2001 From: qtfkwk Date: Wed, 21 Aug 2024 04:07:22 -0400 Subject: [PATCH] Fix issue #1141 (#1142) --- src/cli.rs | 2 -- src/cli_utils.rs | 4 ---- src/consts.rs | 15 +++++++++++++++ src/lib.rs | 1 + src/utils/ext.rs | 5 ----- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index caf7757..a697bb0 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -52,7 +52,6 @@ pub struct Cli { pub types: Option>, pub compact: bool, pub number_format: num_format::CustomFormat, - pub verbose: u64, } impl Cli { @@ -312,7 +311,6 @@ impl Cli { types, compact, number_format, - verbose, }; debug!("CLI Config: {:#?}", cli); diff --git a/src/cli_utils.rs b/src/cli_utils.rs index fbbd918..9bedce9 100644 --- a/src/cli_utils.rs +++ b/src/cli_utils.rs @@ -111,10 +111,6 @@ impl NumberFormatStyle { } } - pub fn all() -> &'static [&'static str] { - &["commas", "dots", "plain", "underscores"] - } - pub fn get_format(self) -> Result { num_format::CustomFormat::builder() .grouping(num_format::Grouping::Standard) diff --git a/src/consts.rs b/src/consts.rs index 3795d5d..ce451da 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -1,12 +1,27 @@ // Set of common pub consts. +/// Fallback row length pub const FALLBACK_ROW_LEN: usize = 81; // Column widths used for console printing. + +/// Language column width pub const LANGUAGE_COLUMN_WIDTH: usize = 10; + +/// Path column width pub const PATH_COLUMN_WIDTH: usize = 80; + +/// Files column width pub const FILES_COLUMN_WIDTH: usize = 8; + +/// Lines column width pub const LINES_COLUMN_WIDTH: usize = 12; + +/// Code column width pub const CODE_COLUMN_WIDTH: usize = 12; + +/// Comments column width pub const COMMENTS_COLUMN_WIDTH: usize = 12; + +/// Blanks column width pub const BLANKS_COLUMN_WIDTH: usize = 12; diff --git a/src/lib.rs b/src/lib.rs index 7b89e4f..a2b4d0e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -57,6 +57,7 @@ mod stats; pub use self::{ config::Config, + consts::*, language::{Language, LanguageType, Languages}, sort::Sort, stats::{find_char_boundary, CodeStats, Report}, diff --git a/src/utils/ext.rs b/src/utils/ext.rs index f3f641c..bc526de 100644 --- a/src/utils/ext.rs +++ b/src/utils/ext.rs @@ -2,7 +2,6 @@ pub(crate) trait AsciiExt { fn is_whitespace(&self) -> bool; - fn is_not_line_ending_whitespace(&self) -> bool; fn is_line_ending_whitespace(&self) -> bool; } @@ -11,10 +10,6 @@ impl AsciiExt for u8 { *self == b' ' || (b'\x09'..=b'\x0d').contains(self) } - fn is_not_line_ending_whitespace(&self) -> bool { - self.is_whitespace() && !self.is_line_ending_whitespace() - } - fn is_line_ending_whitespace(&self) -> bool { *self == b'\n' }