This commit is contained in:
qtfkwk 2024-08-21 04:07:22 -04:00 committed by GitHub
parent d193df05ec
commit 2645a116d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 11 deletions

View file

@ -52,7 +52,6 @@ pub struct Cli {
pub types: Option<Vec<LanguageType>>,
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);

View file

@ -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, num_format::Error> {
num_format::CustomFormat::builder()
.grouping(num_format::Grouping::Standard)

View file

@ -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;

View file

@ -57,6 +57,7 @@ mod stats;
pub use self::{
config::Config,
consts::*,
language::{Language, LanguageType, Languages},
sort::Sort,
stats::{find_char_boundary, CodeStats, Report},

View file

@ -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'
}