diff --git a/src/cmd/apply.rs b/src/cmd/apply.rs index e2d591879..67ab25b23 100644 --- a/src/cmd/apply.rs +++ b/src/cmd/apply.rs @@ -292,24 +292,24 @@ static OPERATIONS: &[&str] = &[ #[derive(Deserialize, Debug)] struct Args { - arg_column: SelectColumns, - cmd_operations: bool, - arg_operations: String, - cmd_datefmt: bool, - cmd_dynfmt: bool, + arg_column: SelectColumns, + cmd_operations: bool, + arg_operations: String, + cmd_datefmt: bool, + cmd_dynfmt: bool, cmd_emptyreplace: bool, - cmd_geocode: bool, - arg_input: Option, - flag_rename: Option, - flag_comparand: String, + cmd_geocode: bool, + arg_input: Option, + flag_rename: Option, + flag_comparand: String, flag_replacement: String, - flag_prefer_dmy: bool, - flag_formatstr: String, - flag_jobs: Option, - flag_new_column: Option, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, + flag_prefer_dmy: bool, + flag_formatstr: String, + flag_jobs: Option, + flag_new_column: Option, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, flag_progressbar: bool, } diff --git a/src/cmd/behead.rs b/src/cmd/behead.rs index dabda3d35..98762d9a9 100644 --- a/src/cmd/behead.rs +++ b/src/cmd/behead.rs @@ -21,9 +21,9 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, + arg_input: Option, flag_delimiter: Option, - flag_output: Option, + flag_output: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/cat.rs b/src/cmd/cat.rs index 91a07c4b2..780c7d761 100644 --- a/src/cmd/cat.rs +++ b/src/cmd/cat.rs @@ -41,13 +41,13 @@ use crate::{ #[derive(Deserialize)] struct Args { - cmd_rows: bool, - cmd_columns: bool, - arg_input: Vec, - flag_pad: bool, - flag_output: Option, + cmd_rows: bool, + cmd_columns: bool, + arg_input: Vec, + flag_pad: bool, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/count.rs b/src/cmd/count.rs index 0913cbe4d..eefef0fd5 100644 --- a/src/cmd/count.rs +++ b/src/cmd/count.rs @@ -29,10 +29,10 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, + arg_input: Option, flag_human_readable: bool, - flag_no_headers: bool, - flag_delimiter: Option, + flag_no_headers: bool, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/dedup.rs b/src/cmd/dedup.rs index 31f428d29..afaa2b0de 100644 --- a/src/cmd/dedup.rs +++ b/src/cmd/dedup.rs @@ -59,16 +59,16 @@ use crate::{ }; #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_select: SelectColumns, - flag_no_case: bool, - flag_sorted: bool, - flag_dupes_output: Option, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, + arg_input: Option, + flag_select: SelectColumns, + flag_no_case: bool, + flag_sorted: bool, + flag_dupes_output: Option, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, flag_human_readable: bool, - flag_jobs: Option, + flag_jobs: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/enumerate.rs b/src/cmd/enumerate.rs index 308753844..9a7eacde7 100644 --- a/src/cmd/enumerate.rs +++ b/src/cmd/enumerate.rs @@ -59,14 +59,14 @@ const NULL_VALUE: &str = ""; #[derive(Deserialize)] struct Args { - arg_input: Option, + arg_input: Option, flag_new_column: Option, - flag_constant: Option, - flag_copy: Option, - flag_uuid: bool, - flag_output: Option, + flag_constant: Option, + flag_copy: Option, + flag_uuid: bool, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/excel.rs b/src/cmd/excel.rs index 254428b3a..78a808ce9 100644 --- a/src/cmd/excel.rs +++ b/src/cmd/excel.rs @@ -67,13 +67,13 @@ use crate::{config::Config, util, CliResult}; #[derive(Deserialize)] struct Args { - arg_input: String, - flag_sheet: String, - flag_metadata: bool, - flag_flexible: bool, - flag_trim: bool, + arg_input: String, + flag_sheet: String, + flag_metadata: bool, + flag_flexible: bool, + flag_trim: bool, flag_dates_whitelist: String, - flag_output: Option, + flag_output: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/exclude.rs b/src/cmd/exclude.rs index 37d4d3b0d..1a666fe0c 100644 --- a/src/cmd/exclude.rs +++ b/src/cmd/exclude.rs @@ -49,15 +49,15 @@ type ByteString = Vec; #[derive(Deserialize)] struct Args { - arg_columns1: SelectColumns, - arg_input1: String, - arg_columns2: SelectColumns, - arg_input2: String, - flag_v: bool, - flag_output: Option, + arg_columns1: SelectColumns, + arg_input1: String, + arg_columns2: SelectColumns, + arg_input2: String, + flag_v: bool, + flag_output: Option, flag_no_headers: bool, - flag_no_case: bool, - flag_delimiter: Option, + flag_no_case: bool, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { @@ -68,13 +68,13 @@ pub fn run(argv: &[&str]) -> CliResult<()> { } struct IoState { - wtr: csv::Writer, - rdr1: csv::Reader, - sel1: Selection, - rdr2: csv::Reader, - sel2: Selection, + wtr: csv::Writer, + rdr1: csv::Reader, + sel1: Selection, + rdr2: csv::Reader, + sel2: Selection, no_headers: bool, - casei: bool, + casei: bool, } impl IoState { @@ -164,8 +164,8 @@ impl Args { #[allow(dead_code)] struct ValueIndex { // This maps tuples of values to corresponding rows. - values: AHashMap, Vec>, - idx: Indexed>>, + values: AHashMap, Vec>, + idx: Indexed>>, num_rows: usize, } diff --git a/src/cmd/explode.rs b/src/cmd/explode.rs index 7a3f2e3c6..9b127bfff 100644 --- a/src/cmd/explode.rs +++ b/src/cmd/explode.rs @@ -40,13 +40,13 @@ use crate::{ }; #[derive(Deserialize)] struct Args { - arg_column: SelectColumns, - arg_separator: String, - arg_input: Option, - flag_rename: Option, - flag_output: Option, + arg_column: SelectColumns, + arg_separator: String, + arg_input: Option, + flag_rename: Option, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn replace_column_value( diff --git a/src/cmd/extsort.rs b/src/cmd/extsort.rs index 1b4d999a9..b58aad91e 100644 --- a/src/cmd/extsort.rs +++ b/src/cmd/extsort.rs @@ -39,9 +39,9 @@ use crate::{util, CliResult}; #[derive(Deserialize)] struct Args { - arg_input: String, - arg_output: String, - flag_jobs: Option, + arg_input: String, + arg_output: String, + flag_jobs: Option, flag_no_headers: bool, } diff --git a/src/cmd/fetch.rs b/src/cmd/fetch.rs index bdfcbd72b..41f55d292 100644 --- a/src/cmd/fetch.rs +++ b/src/cmd/fetch.rs @@ -203,27 +203,27 @@ use crate::{ #[derive(Deserialize, Debug)] struct Args { flag_url_template: Option, - flag_new_column: Option, - flag_jql: Option, - flag_jqlfile: Option, - flag_pretty: bool, - flag_rate_limit: u32, - flag_timeout: u64, - flag_http_header: Vec, - flag_max_retries: u8, - flag_max_errors: u64, - flag_store_error: bool, - flag_cache_error: bool, - flag_cookies: bool, - flag_report: String, - flag_redis: bool, - flag_flushdb: bool, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, - flag_progressbar: bool, - arg_url_column: SelectColumns, - arg_input: Option, + flag_new_column: Option, + flag_jql: Option, + flag_jqlfile: Option, + flag_pretty: bool, + flag_rate_limit: u32, + flag_timeout: u64, + flag_http_header: Vec, + flag_max_retries: u8, + flag_max_errors: u64, + flag_store_error: bool, + flag_cache_error: bool, + flag_cookies: bool, + flag_report: String, + flag_redis: bool, + flag_flushdb: bool, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, + flag_progressbar: bool, + arg_url_column: SelectColumns, + arg_input: Option, } // connect to Redis at localhost, using database 1 by default when --redis is enabled @@ -244,34 +244,34 @@ impl From for CliError { } } struct RedisConfig { - conn_str: String, + conn_str: String, max_pool_size: u32, - ttl_secs: u64, - ttl_refresh: bool, + ttl_secs: u64, + ttl_refresh: bool, } impl RedisConfig { fn load() -> Self { Self { - conn_str: std::env::var("QSV_REDIS_CONNSTR") + conn_str: std::env::var("QSV_REDIS_CONNSTR") .unwrap_or_else(|_| DEFAULT_REDIS_CONN_STR.to_string()), max_pool_size: std::env::var("QSV_REDIS_MAX_POOL_SIZE") .unwrap_or_else(|_| DEFAULT_REDIS_POOL_SIZE.to_string()) .parse() .unwrap_or(DEFAULT_REDIS_POOL_SIZE), - ttl_secs: std::env::var("QSV_REDIS_TTL_SECS") + ttl_secs: std::env::var("QSV_REDIS_TTL_SECS") .unwrap_or_else(|_| DEFAULT_REDIS_TTL_SECS.to_string()) .parse() .unwrap_or(DEFAULT_REDIS_TTL_SECS), - ttl_refresh: std::env::var("QSV_REDIS_TTL_REFRESH").is_ok(), + ttl_refresh: std::env::var("QSV_REDIS_TTL_REFRESH").is_ok(), } } } #[derive(Serialize, Deserialize, Debug, Clone)] struct FetchResponse { - response: String, + response: String, status_code: u16, - retries: u8, + retries: u8, } static REDISCONFIG: Lazy = Lazy::new(RedisConfig::load); @@ -543,29 +543,29 @@ pub fn run(argv: &[&str]) -> CliResult<()> { #[allow(unused_assignments)] let mut intermediate_redis_value: Return = Return { was_cached: false, - value: String::new(), + value: String::new(), }; #[allow(unused_assignments)] let mut intermediate_value: Return = Return { was_cached: false, - value: FetchResponse { - response: String::new(), + value: FetchResponse { + response: String::new(), status_code: 0_u16, - retries: 0_u8, + retries: 0_u8, }, }; #[allow(unused_assignments)] let mut final_value = String::with_capacity(150); #[allow(unused_assignments)] let mut final_response = FetchResponse { - response: String::new(), + response: String::new(), status_code: 0_u16, - retries: 0_u8, + retries: 0_u8, }; let empty_response = FetchResponse { - response: String::new(), + response: String::new(), status_code: 0_u16, - retries: 0_u8, + retries: 0_u8, }; let mut running_error_count = 0_u64; let mut running_success_count = 0_u64; @@ -867,9 +867,9 @@ fn get_response( }; error!("Invalid URL: Store_error: {flag_store_error} - {url_invalid_err}"); return FetchResponse { - response: url_invalid_err, + response: url_invalid_err, status_code: reqwest::StatusCode::NOT_FOUND.as_u16(), - retries: 0_u8, + retries: 0_u8, }; } }; diff --git a/src/cmd/fetchpost.rs b/src/cmd/fetchpost.rs index 2ce14916d..51257b275 100644 --- a/src/cmd/fetchpost.rs +++ b/src/cmd/fetchpost.rs @@ -177,28 +177,28 @@ use crate::{ #[derive(Deserialize, Debug)] struct Args { - flag_new_column: Option, - flag_jql: Option, - flag_jqlfile: Option, - flag_pretty: bool, - flag_rate_limit: u32, - flag_timeout: u64, + flag_new_column: Option, + flag_jql: Option, + flag_jqlfile: Option, + flag_pretty: bool, + flag_rate_limit: u32, + flag_timeout: u64, flag_http_header: Vec, flag_max_retries: u8, - flag_max_errors: u64, + flag_max_errors: u64, flag_store_error: bool, flag_cache_error: bool, - flag_cookies: bool, - flag_report: String, - flag_redis: bool, - flag_flushdb: bool, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, + flag_cookies: bool, + flag_report: String, + flag_redis: bool, + flag_flushdb: bool, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, flag_progressbar: bool, - arg_url_column: SelectColumns, - arg_column_list: SelectColumns, - arg_input: Option, + arg_url_column: SelectColumns, + arg_column_list: SelectColumns, + arg_input: Option, } // connect to Redis at localhost, using database 2 by default when --redis is enabled @@ -214,34 +214,34 @@ const FETCHPOST_REPORT_SUFFIX: &str = ".fetchpost-report.tsv"; static DEFAULT_ACCEPT_ENCODING: &str = "br;q=1.0, gzip;q=0.6, deflate;q=0.4, *;q=0.2"; struct RedisConfig { - conn_str: String, + conn_str: String, max_pool_size: u32, - ttl_secs: u64, - ttl_refresh: bool, + ttl_secs: u64, + ttl_refresh: bool, } impl RedisConfig { fn load() -> Self { Self { - conn_str: std::env::var("QSV_FP_REDIS_CONNSTR") + conn_str: std::env::var("QSV_FP_REDIS_CONNSTR") .unwrap_or_else(|_| DEFAULT_FP_REDIS_CONN_STR.to_string()), max_pool_size: std::env::var("QSV_REDIS_MAX_POOL_SIZE") .unwrap_or_else(|_| DEFAULT_FP_REDIS_POOL_SIZE.to_string()) .parse() .unwrap_or(DEFAULT_FP_REDIS_POOL_SIZE), - ttl_secs: std::env::var("QSV_REDIS_TTL_SECS") + ttl_secs: std::env::var("QSV_REDIS_TTL_SECS") .unwrap_or_else(|_| DEFAULT_FP_REDIS_TTL_SECS.to_string()) .parse() .unwrap_or(DEFAULT_FP_REDIS_TTL_SECS), - ttl_refresh: std::env::var("QSV_REDIS_TTL_REFRESH").is_ok(), + ttl_refresh: std::env::var("QSV_REDIS_TTL_REFRESH").is_ok(), } } } #[derive(Serialize, Deserialize, Debug, Clone)] struct FetchResponse { - response: String, + response: String, status_code: u16, - retries: u8, + retries: u8, } static REDISCONFIG: Lazy = Lazy::new(RedisConfig::load); @@ -504,29 +504,29 @@ pub fn run(argv: &[&str]) -> CliResult<()> { #[allow(unused_assignments)] let mut intermediate_redis_value: Return = Return { was_cached: false, - value: String::new(), + value: String::new(), }; #[allow(unused_assignments)] let mut intermediate_value: Return = Return { was_cached: false, - value: FetchResponse { - response: String::new(), + value: FetchResponse { + response: String::new(), status_code: 0_u16, - retries: 0_u8, + retries: 0_u8, }, }; #[allow(unused_assignments)] let mut final_value = String::with_capacity(150); #[allow(unused_assignments)] let mut final_response = FetchResponse { - response: String::new(), + response: String::new(), status_code: 0_u16, - retries: 0_u8, + retries: 0_u8, }; let empty_response = FetchResponse { - response: String::new(), + response: String::new(), status_code: 0_u16, - retries: 0_u8, + retries: 0_u8, }; let mut running_error_count = 0_u64; let mut running_success_count = 0_u64; @@ -838,9 +838,9 @@ fn get_response( }; error!("Invalid URL: Store_error: {flag_store_error} - {url_invalid_err}"); return FetchResponse { - response: url_invalid_err, + response: url_invalid_err, status_code: reqwest::StatusCode::NOT_FOUND.as_u16(), - retries: 0_u8, + retries: 0_u8, }; } }; diff --git a/src/cmd/fill.rs b/src/cmd/fill.rs index a210f47ed..a18f8dfa5 100644 --- a/src/cmd/fill.rs +++ b/src/cmd/fill.rs @@ -66,15 +66,15 @@ type BoxedReader = csv::Reader>; #[derive(Deserialize)] struct Args { - arg_input: Option, - arg_selection: SelectColumns, - flag_output: Option, + arg_input: Option, + arg_selection: SelectColumns, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, - flag_groupby: Option, - flag_first: bool, - flag_backfill: bool, - flag_default: Option, + flag_delimiter: Option, + flag_groupby: Option, + flag_first: bool, + flag_backfill: bool, + flag_default: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { @@ -160,7 +160,7 @@ impl GroupKeyConstructor for GroupKeySelection { #[derive(Debug)] struct GroupValues { - map: AHashMap, + map: AHashMap, default: Option, } @@ -215,12 +215,12 @@ impl GroupMemorizer for GroupValues { } struct Filler { - grouper: Grouper, - groupby: GroupKeySelection, - select: Selection, - buffer: GroupBuffer, - first: bool, - backfill: bool, + grouper: Grouper, + groupby: GroupKeySelection, + select: Selection, + buffer: GroupBuffer, + first: bool, + backfill: bool, default_value: Option, } @@ -304,11 +304,11 @@ impl Filler { } struct MapSelected { - selection: Vec, + selection: Vec, selection_index: usize, - index: usize, - iterator: I, - predicate: F, + index: usize, + iterator: I, + predicate: F, } impl iter::Iterator for MapSelected diff --git a/src/cmd/fixlengths.rs b/src/cmd/fixlengths.rs index 65a60cbf3..b1c256ac1 100644 --- a/src/cmd/fixlengths.rs +++ b/src/cmd/fixlengths.rs @@ -37,9 +37,9 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_length: Option, - flag_output: Option, + arg_input: Option, + flag_length: Option, + flag_output: Option, flag_delimiter: Option, } diff --git a/src/cmd/flatten.rs b/src/cmd/flatten.rs index 1bed6aa56..2ec4045a9 100644 --- a/src/cmd/flatten.rs +++ b/src/cmd/flatten.rs @@ -45,11 +45,11 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_condense: Option, - flag_separator: String, + arg_input: Option, + flag_condense: Option, + flag_separator: String, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/fmt.rs b/src/cmd/fmt.rs index 00870802a..bd24d0c21 100644 --- a/src/cmd/fmt.rs +++ b/src/cmd/fmt.rs @@ -38,16 +38,16 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, + arg_input: Option, flag_out_delimiter: Option, - flag_crlf: bool, - flag_ascii: bool, - flag_output: Option, - flag_delimiter: Option, - flag_quote: Delimiter, - flag_quote_always: bool, - flag_quote_never: bool, - flag_escape: Option, + flag_crlf: bool, + flag_ascii: bool, + flag_output: Option, + flag_delimiter: Option, + flag_quote: Delimiter, + flag_quote_always: bool, + flag_quote_never: bool, + flag_escape: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/foreach.rs b/src/cmd/foreach.rs index 96c7d6b56..fc8f588d5 100644 --- a/src/cmd/foreach.rs +++ b/src/cmd/foreach.rs @@ -54,13 +54,13 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_column: SelectColumns, - arg_command: String, - arg_input: Option, - flag_unify: bool, - flag_new_column: Option, - flag_no_headers: bool, - flag_delimiter: Option, + arg_column: SelectColumns, + arg_command: String, + arg_input: Option, + flag_unify: bool, + flag_new_column: Option, + flag_no_headers: bool, + flag_delimiter: Option, flag_progressbar: bool, } diff --git a/src/cmd/frequency.rs b/src/cmd/frequency.rs index 1953e8f84..0869882dd 100644 --- a/src/cmd/frequency.rs +++ b/src/cmd/frequency.rs @@ -61,15 +61,15 @@ use crate::{ #[derive(Clone, Deserialize)] pub struct Args { - pub arg_input: Option, - pub flag_select: SelectColumns, - pub flag_limit: usize, - pub flag_asc: bool, - pub flag_no_nulls: bool, - pub flag_jobs: Option, - pub flag_output: Option, + pub arg_input: Option, + pub flag_select: SelectColumns, + pub flag_limit: usize, + pub flag_asc: bool, + pub flag_no_nulls: bool, + pub flag_jobs: Option, + pub flag_output: Option, pub flag_no_headers: bool, - pub flag_delimiter: Option, + pub flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/generate.rs b/src/cmd/generate.rs index f8d1636d5..6c99eaea3 100644 --- a/src/cmd/generate.rs +++ b/src/cmd/generate.rs @@ -67,11 +67,11 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_rows: u32, - flag_output: Option, - flag_outdsp: Option, - flag_indsp: Option, + arg_input: Option, + flag_rows: u32, + flag_output: Option, + flag_outdsp: Option, + flag_indsp: Option, flag_delimiter: Option, } diff --git a/src/cmd/headers.rs b/src/cmd/headers.rs index ebf30f5e7..ffe2e1508 100644 --- a/src/cmd/headers.rs +++ b/src/cmd/headers.rs @@ -33,10 +33,10 @@ use crate::{config::Delimiter, util, CliResult}; #[derive(Deserialize)] struct Args { - arg_input: Vec, + arg_input: Vec, flag_just_names: bool, - flag_intersect: bool, - flag_delimiter: Option, + flag_intersect: bool, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/index.rs b/src/cmd/index.rs index 9e748db67..1bf673d2c 100644 --- a/src/cmd/index.rs +++ b/src/cmd/index.rs @@ -43,8 +43,8 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: String, - flag_output: Option, + arg_input: String, + flag_output: Option, flag_delimiter: Option, } diff --git a/src/cmd/input.rs b/src/cmd/input.rs index a3b72614e..66c87d203 100644 --- a/src/cmd/input.rs +++ b/src/cmd/input.rs @@ -49,17 +49,17 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_output: Option, - flag_delimiter: Option, - flag_quote: Delimiter, - flag_escape: Option, - flag_no_quoting: bool, - flag_skip_lines: Option, + arg_input: Option, + flag_output: Option, + flag_delimiter: Option, + flag_quote: Delimiter, + flag_escape: Option, + flag_no_quoting: bool, + flag_skip_lines: Option, flag_skip_lastlines: Option, - flag_auto_skip: bool, - flag_trim_headers: bool, - flag_trim_fields: bool, + flag_auto_skip: bool, + flag_trim_headers: bool, + flag_trim_fields: bool, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/join.rs b/src/cmd/join.rs index 572cda280..c9edcce0e 100644 --- a/src/cmd/join.rs +++ b/src/cmd/join.rs @@ -82,21 +82,21 @@ type ByteString = Vec; #[derive(Deserialize)] struct Args { - arg_columns1: SelectColumns, - arg_input1: String, - arg_columns2: SelectColumns, - arg_input2: String, - flag_left: bool, - flag_left_anti: bool, - flag_left_semi: bool, - flag_right: bool, - flag_full: bool, - flag_cross: bool, - flag_output: Option, + arg_columns1: SelectColumns, + arg_input1: String, + arg_columns2: SelectColumns, + arg_input2: String, + flag_left: bool, + flag_left_anti: bool, + flag_left_semi: bool, + flag_right: bool, + flag_full: bool, + flag_cross: bool, + flag_output: Option, flag_no_headers: bool, - flag_no_case: bool, - flag_nulls: bool, - flag_delimiter: Option, + flag_no_case: bool, + flag_nulls: bool, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { @@ -143,14 +143,14 @@ pub fn run(argv: &[&str]) -> CliResult<()> { } struct IoState { - wtr: csv::Writer, - rdr1: csv::Reader, - sel1: Selection, - rdr2: csv::Reader, - sel2: Selection, + wtr: csv::Writer, + rdr1: csv::Reader, + sel1: Selection, + rdr2: csv::Reader, + sel2: Selection, no_headers: bool, - casei: bool, - nulls: bool, + casei: bool, + nulls: bool, } impl IoState { @@ -377,8 +377,8 @@ impl Args { struct ValueIndex { // This maps tuples of values to corresponding rows. - values: AHashMap, Vec>, - idx: Indexed>>, + values: AHashMap, Vec>, + idx: Indexed>>, num_rows: usize, } diff --git a/src/cmd/jsonl.rs b/src/cmd/jsonl.rs index c552737b9..24e53fa51 100644 --- a/src/cmd/jsonl.rs +++ b/src/cmd/jsonl.rs @@ -29,7 +29,7 @@ use crate::{config::Config, util, CliResult}; #[derive(Deserialize)] struct Args { - arg_input: Option, + arg_input: Option, flag_output: Option, } diff --git a/src/cmd/lua.rs b/src/cmd/lua.rs index 9ddc5dac8..814ed434a 100644 --- a/src/cmd/lua.rs +++ b/src/cmd/lua.rs @@ -89,17 +89,17 @@ use crate::{ #[derive(Deserialize)] struct Args { - cmd_map: bool, - cmd_filter: bool, - arg_new_column: Option, - arg_script: String, - arg_input: Option, - flag_exec: bool, + cmd_map: bool, + cmd_filter: bool, + arg_new_column: Option, + arg_script: String, + arg_input: Option, + flag_exec: bool, flag_script_file: bool, - flag_no_globals: bool, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, + flag_no_globals: bool, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, flag_progressbar: bool, } diff --git a/src/cmd/luajit.rs b/src/cmd/luajit.rs index 56e59cb72..5d83be1cb 100644 --- a/src/cmd/luajit.rs +++ b/src/cmd/luajit.rs @@ -92,17 +92,17 @@ use crate::{ #[derive(Deserialize)] struct Args { - cmd_map: bool, - cmd_filter: bool, - arg_new_column: Option, - arg_script: String, - arg_input: Option, - flag_exec: bool, + cmd_map: bool, + cmd_filter: bool, + arg_new_column: Option, + arg_script: String, + arg_input: Option, + flag_exec: bool, flag_script_file: bool, - flag_no_globals: bool, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, + flag_no_globals: bool, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, flag_progressbar: bool, } diff --git a/src/cmd/partition.rs b/src/cmd/partition.rs index 5a853914f..e0ae873e5 100644 --- a/src/cmd/partition.rs +++ b/src/cmd/partition.rs @@ -47,14 +47,14 @@ use crate::{ #[derive(Clone, Deserialize)] struct Args { - arg_column: SelectColumns, - arg_input: Option, - arg_outdir: String, - flag_filename: FilenameTemplate, + arg_column: SelectColumns, + arg_input: Option, + arg_outdir: String, + flag_filename: FilenameTemplate, flag_prefix_length: Option, - flag_drop: bool, - flag_no_headers: bool, - flag_delimiter: Option, + flag_drop: bool, + flag_no_headers: bool, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { @@ -146,9 +146,9 @@ type BoxedWriter = csv::Writer>; /// Generates unique filenames based on CSV values. struct WriterGenerator { - template: FilenameTemplate, - counter: usize, - used: HashSet, + template: FilenameTemplate, + counter: usize, + used: HashSet, non_word_char: Regex, } diff --git a/src/cmd/pseudo.rs b/src/cmd/pseudo.rs index 827dfe4fc..d84d20cbb 100644 --- a/src/cmd/pseudo.rs +++ b/src/cmd/pseudo.rs @@ -26,11 +26,11 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_column: SelectColumns, - arg_input: Option, - flag_output: Option, + arg_column: SelectColumns, + arg_input: Option, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn replace_column_value( diff --git a/src/cmd/python.rs b/src/cmd/python.rs index 9f65ef57d..880e48687 100644 --- a/src/cmd/python.rs +++ b/src/cmd/python.rs @@ -149,16 +149,16 @@ class QSVRow(object): #[derive(Deserialize)] struct Args { - cmd_map: bool, - cmd_filter: bool, - arg_new_column: Option, - arg_script: String, - flag_batch: u32, - flag_helper: Option, - arg_input: Option, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, + cmd_map: bool, + cmd_filter: bool, + arg_new_column: Option, + arg_script: String, + flag_batch: u32, + flag_helper: Option, + arg_input: Option, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, flag_progressbar: bool, } diff --git a/src/cmd/rename.rs b/src/cmd/rename.rs index 046cbfcca..1e41b95a9 100644 --- a/src/cmd/rename.rs +++ b/src/cmd/rename.rs @@ -31,11 +31,11 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - arg_headers: String, - flag_output: Option, + arg_input: Option, + arg_headers: String, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/replace.rs b/src/cmd/replace.rs index dff916c5e..5396285d4 100644 --- a/src/cmd/replace.rs +++ b/src/cmd/replace.rs @@ -63,18 +63,18 @@ use crate::{ #[allow(dead_code)] #[derive(Deserialize)] struct Args { - arg_input: Option, - arg_pattern: String, - arg_replacement: String, - flag_select: SelectColumns, - flag_unicode: bool, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, - flag_ignore_case: bool, - flag_size_limit: usize, + arg_input: Option, + arg_pattern: String, + arg_replacement: String, + flag_select: SelectColumns, + flag_unicode: bool, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, + flag_ignore_case: bool, + flag_size_limit: usize, flag_dfa_size_limit: usize, - flag_progressbar: bool, + flag_progressbar: bool, } const NULL_VALUE: &str = ""; diff --git a/src/cmd/reverse.rs b/src/cmd/reverse.rs index f8346e877..cb438bf7d 100644 --- a/src/cmd/reverse.rs +++ b/src/cmd/reverse.rs @@ -30,10 +30,10 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_output: Option, + arg_input: Option, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/sample.rs b/src/cmd/sample.rs index ddab4b948..e08949ca0 100644 --- a/src/cmd/sample.rs +++ b/src/cmd/sample.rs @@ -48,12 +48,12 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, + arg_input: Option, arg_sample_size: f64, - flag_output: Option, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, - flag_seed: Option, + flag_delimiter: Option, + flag_seed: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/schema.rs b/src/cmd/schema.rs index cc48bc055..d2a3ddc2f 100644 --- a/src/cmd/schema.rs +++ b/src/cmd/schema.rs @@ -67,16 +67,16 @@ use crate::{ #[derive(Deserialize, Clone)] pub struct Args { - pub flag_enum_threshold: usize, - pub flag_strict_dates: bool, + pub flag_enum_threshold: usize, + pub flag_strict_dates: bool, pub flag_pattern_columns: SelectColumns, pub flag_dates_whitelist: String, - pub flag_prefer_dmy: bool, - pub flag_stdout: bool, - pub flag_jobs: Option, - pub flag_no_headers: bool, - pub flag_delimiter: Option, - pub arg_input: Option, + pub flag_prefer_dmy: bool, + pub flag_stdout: bool, + pub flag_jobs: Option, + pub flag_no_headers: bool, + pub flag_delimiter: Option, + pub arg_input: Option, } const STDIN_CSV: &str = "stdin.csv"; @@ -360,22 +360,22 @@ pub fn infer_schema_from_stats(args: &Args, input_filename: &str) -> CliResult CliResult<(ByteRecord, Vec, AHashMap)> { let stats_args = crate::cmd::stats::Args { - arg_input: args.arg_input.clone(), - flag_select: crate::select::SelectColumns::parse("").unwrap(), - flag_everything: false, - flag_mode: false, - flag_cardinality: true, - flag_median: false, - flag_quartiles: false, - flag_nulls: false, - flag_round: 4, - flag_infer_dates: true, + arg_input: args.arg_input.clone(), + flag_select: crate::select::SelectColumns::parse("").unwrap(), + flag_everything: false, + flag_mode: false, + flag_cardinality: true, + flag_median: false, + flag_quartiles: false, + flag_nulls: false, + flag_round: 4, + flag_infer_dates: true, flag_dates_whitelist: args.flag_dates_whitelist.to_string(), - flag_prefer_dmy: args.flag_prefer_dmy, - flag_jobs: Some(util::njobs(args.flag_jobs)), - flag_output: None, - flag_no_headers: args.flag_no_headers, - flag_delimiter: args.flag_delimiter, + flag_prefer_dmy: args.flag_prefer_dmy, + flag_jobs: Some(util::njobs(args.flag_jobs)), + flag_output: None, + flag_no_headers: args.flag_no_headers, + flag_delimiter: args.flag_delimiter, }; let (csv_fields, csv_stats) = match stats_args.rconfig().indexed() { @@ -456,15 +456,15 @@ fn get_unique_values( ) -> CliResult>> { // prepare arg for invoking cmd::frequency let freq_args = crate::cmd::frequency::Args { - arg_input: args.arg_input.clone(), - flag_select: crate::select::SelectColumns::parse(column_select_arg).unwrap(), - flag_limit: args.flag_enum_threshold, - flag_asc: false, - flag_no_nulls: true, - flag_jobs: Some(util::njobs(args.flag_jobs)), - flag_output: None, + arg_input: args.arg_input.clone(), + flag_select: crate::select::SelectColumns::parse(column_select_arg).unwrap(), + flag_limit: args.flag_enum_threshold, + flag_asc: false, + flag_no_nulls: true, + flag_jobs: Some(util::njobs(args.flag_jobs)), + flag_output: None, flag_no_headers: args.flag_no_headers, - flag_delimiter: args.flag_delimiter, + flag_delimiter: args.flag_delimiter, }; let (headers, ftables) = match freq_args.rconfig().indexed()? { diff --git a/src/cmd/search.rs b/src/cmd/search.rs index e6e35e907..bcb1e40e7 100644 --- a/src/cmd/search.rs +++ b/src/cmd/search.rs @@ -70,20 +70,20 @@ use crate::{ #[allow(dead_code)] #[derive(Deserialize)] struct Args { - arg_input: Option, - arg_regex: String, - flag_select: SelectColumns, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, - flag_invert_match: bool, - flag_unicode: bool, - flag_ignore_case: bool, - flag_flag: Option, - flag_size_limit: usize, + arg_input: Option, + arg_regex: String, + flag_select: SelectColumns, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, + flag_invert_match: bool, + flag_unicode: bool, + flag_ignore_case: bool, + flag_flag: Option, + flag_size_limit: usize, flag_dfa_size_limit: usize, - flag_quick: bool, - flag_progressbar: bool, + flag_quick: bool, + flag_progressbar: bool, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/searchset.rs b/src/cmd/searchset.rs index 010b5be30..ae144ea00 100644 --- a/src/cmd/searchset.rs +++ b/src/cmd/searchset.rs @@ -81,20 +81,20 @@ use crate::{ #[allow(dead_code)] #[derive(Deserialize)] struct Args { - arg_input: Option, - arg_regexset_file: String, - flag_select: SelectColumns, - flag_output: Option, - flag_no_headers: bool, - flag_delimiter: Option, - flag_invert_match: bool, - flag_unicode: bool, - flag_ignore_case: bool, - flag_flag: Option, - flag_size_limit: usize, + arg_input: Option, + arg_regexset_file: String, + flag_select: SelectColumns, + flag_output: Option, + flag_no_headers: bool, + flag_delimiter: Option, + flag_invert_match: bool, + flag_unicode: bool, + flag_ignore_case: bool, + flag_flag: Option, + flag_size_limit: usize, flag_dfa_size_limit: usize, - flag_quick: bool, - flag_progressbar: bool, + flag_quick: bool, + flag_progressbar: bool, } fn read_regexset(filename: &String) -> io::Result> { diff --git a/src/cmd/select.rs b/src/cmd/select.rs index 0f1f8c88e..c84f9d2ad 100644 --- a/src/cmd/select.rs +++ b/src/cmd/select.rs @@ -55,11 +55,11 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - arg_selection: SelectColumns, - flag_output: Option, + arg_input: Option, + arg_selection: SelectColumns, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/slice.rs b/src/cmd/slice.rs index 82356927f..ab05d4487 100644 --- a/src/cmd/slice.rs +++ b/src/cmd/slice.rs @@ -47,14 +47,14 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_start: Option, - flag_end: Option, - flag_len: Option, - flag_index: Option, - flag_output: Option, + arg_input: Option, + flag_start: Option, + flag_end: Option, + flag_len: Option, + flag_index: Option, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/sniff.rs b/src/cmd/sniff.rs index 8cb6c18b9..fce6df2a6 100644 --- a/src/cmd/sniff.rs +++ b/src/cmd/sniff.rs @@ -38,25 +38,25 @@ use crate::{config::Config, util, CliResult}; #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_sample: f64, - flag_prefer_dmy: bool, - flag_json: bool, + arg_input: Option, + flag_sample: f64, + flag_prefer_dmy: bool, + flag_json: bool, flag_pretty_json: bool, } #[derive(Serialize, Deserialize)] struct SniffStruct { delimiter_char: char, - header_row: bool, - preamble_rows: usize, - quote_char: String, - flexible: bool, - is_utf8: bool, - num_records: u64, - num_fields: usize, - fields: Vec, - types: Vec, + header_row: bool, + preamble_rows: usize, + quote_char: String, + flexible: bool, + is_utf8: bool, + num_records: u64, + num_fields: usize, + fields: Vec, + types: Vec, } const fn rowcount(metadata: &qsv_sniffer::metadata::Metadata, rowcount: u64) -> u64 { @@ -133,18 +133,18 @@ pub fn run(argv: &[&str]) -> CliResult<()> { let sniffed = SniffStruct { delimiter_char: metadata.dialect.delimiter as char, - header_row: metadata.dialect.header.has_header_row, - preamble_rows: metadata.dialect.header.num_preamble_rows, - quote_char: match metadata.dialect.quote { + header_row: metadata.dialect.header.has_header_row, + preamble_rows: metadata.dialect.header.num_preamble_rows, + quote_char: match metadata.dialect.quote { qsv_sniffer::metadata::Quote::Some(chr) => format!("{}", char::from(chr)), qsv_sniffer::metadata::Quote::None => "none".into(), }, - flexible: metadata.dialect.flexible, - is_utf8: metadata.dialect.is_utf8, - num_records: rowcount(&metadata, n_rows), - num_fields: metadata.num_fields, - fields: sniffedfields, - types: sniffedtypes, + flexible: metadata.dialect.flexible, + is_utf8: metadata.dialect.is_utf8, + num_records: rowcount(&metadata, n_rows), + num_fields: metadata.num_fields, + fields: sniffedfields, + types: sniffedtypes, }; if args.flag_pretty_json { println!("{}", serde_json::to_string_pretty(&sniffed).unwrap()); diff --git a/src/cmd/sort.rs b/src/cmd/sort.rs index 23fdabfd6..17df4fa1a 100644 --- a/src/cmd/sort.rs +++ b/src/cmd/sort.rs @@ -48,17 +48,17 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_select: SelectColumns, - flag_numeric: bool, - flag_reverse: bool, - flag_random: bool, - flag_seed: Option, - flag_jobs: Option, - flag_output: Option, + arg_input: Option, + flag_select: SelectColumns, + flag_numeric: bool, + flag_reverse: bool, + flag_random: bool, + flag_seed: Option, + flag_jobs: Option, + flag_output: Option, flag_no_headers: bool, - flag_delimiter: Option, - flag_uniq: bool, + flag_delimiter: Option, + flag_uniq: bool, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/sortcheck.rs b/src/cmd/sortcheck.rs index c1e492f7f..6fed2a7eb 100644 --- a/src/cmd/sortcheck.rs +++ b/src/cmd/sortcheck.rs @@ -64,23 +64,23 @@ use crate::{ #[allow(dead_code)] #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_select: SelectColumns, - flag_no_case: bool, - flag_all: bool, - flag_no_headers: bool, - flag_delimiter: Option, + arg_input: Option, + flag_select: SelectColumns, + flag_no_case: bool, + flag_all: bool, + flag_no_headers: bool, + flag_delimiter: Option, flag_progressbar: bool, - flag_json: bool, + flag_json: bool, flag_pretty_json: bool, } #[derive(Serialize, Deserialize)] struct SortCheckStruct { - sorted: bool, - record_count: u64, + sorted: bool, + record_count: u64, unsorted_breaks: u64, - dupe_count: u64, + dupe_count: u64, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/split.rs b/src/cmd/split.rs index fde6af205..f071eeb47 100644 --- a/src/cmd/split.rs +++ b/src/cmd/split.rs @@ -49,14 +49,14 @@ use crate::{ #[derive(Clone, Deserialize)] struct Args { - arg_input: Option, - arg_outdir: String, - flag_size: usize, - flag_jobs: Option, - flag_filename: FilenameTemplate, - flag_pad: usize, + arg_input: Option, + arg_outdir: String, + flag_size: usize, + flag_jobs: Option, + flag_filename: FilenameTemplate, + flag_pad: usize, flag_no_headers: bool, - flag_delimiter: Option, + flag_delimiter: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { diff --git a/src/cmd/stats.rs b/src/cmd/stats.rs index adc0bcdc3..a9a5646e0 100644 --- a/src/cmd/stats.rs +++ b/src/cmd/stats.rs @@ -107,22 +107,22 @@ use crate::{ #[allow(clippy::unsafe_derive_deserialize)] #[derive(Clone, Deserialize)] pub struct Args { - pub arg_input: Option, - pub flag_select: SelectColumns, - pub flag_everything: bool, - pub flag_mode: bool, - pub flag_cardinality: bool, - pub flag_median: bool, - pub flag_quartiles: bool, - pub flag_round: u8, - pub flag_nulls: bool, - pub flag_infer_dates: bool, + pub arg_input: Option, + pub flag_select: SelectColumns, + pub flag_everything: bool, + pub flag_mode: bool, + pub flag_cardinality: bool, + pub flag_median: bool, + pub flag_quartiles: bool, + pub flag_round: u8, + pub flag_nulls: bool, + pub flag_infer_dates: bool, pub flag_dates_whitelist: String, - pub flag_prefer_dmy: bool, - pub flag_jobs: Option, - pub flag_output: Option, - pub flag_no_headers: bool, - pub flag_delimiter: Option, + pub flag_prefer_dmy: bool, + pub flag_jobs: Option, + pub flag_output: Option, + pub flag_no_headers: bool, + pub flag_delimiter: Option, } static INFER_DATE_FLAGS: once_cell::sync::OnceCell> = OnceCell::new(); @@ -291,13 +291,13 @@ impl Args { stats.extend( repeat(Stats::new(WhichStats { include_nulls: self.flag_nulls, - sum: true, - range: true, - dist: true, - cardinality: self.flag_everything || self.flag_cardinality, - median: !self.flag_everything && self.flag_median && !self.flag_quartiles, - quartiles: self.flag_everything || self.flag_quartiles, - mode: self.flag_everything || self.flag_mode, + sum: true, + range: true, + dist: true, + cardinality: self.flag_everything || self.flag_cardinality, + median: !self.flag_everything && self.flag_median && !self.flag_quartiles, + quartiles: self.flag_everything || self.flag_quartiles, + mode: self.flag_everything || self.flag_mode, })) .take(record_len), ); @@ -401,13 +401,13 @@ fn init_date_inference( #[derive(Clone, Debug, Eq, PartialEq)] struct WhichStats { include_nulls: bool, - sum: bool, - range: bool, - dist: bool, - cardinality: bool, - median: bool, - quartiles: bool, - mode: bool, + sum: bool, + range: bool, + dist: bool, + cardinality: bool, + median: bool, + quartiles: bool, + mode: bool, } impl Commute for WhichStats { @@ -419,15 +419,15 @@ impl Commute for WhichStats { #[derive(Clone)] pub struct Stats { - typ: FieldType, - sum: Option, - minmax: Option, - online: Option, + typ: FieldType, + sum: Option, + minmax: Option, + online: Option, nullcount: u64, - modes: Option>>, - median: Option>, + modes: Option>>, + median: Option>, quartiles: Option>, - which: WhichStats, + which: WhichStats, } fn round_num(dec_f64: f64, places: u8) -> String { @@ -782,7 +782,7 @@ impl fmt::Debug for FieldType { #[derive(Clone, Default)] struct TypedSum { integer: i64, - float: Option, + float: Option, } impl TypedSum { @@ -852,11 +852,11 @@ impl Commute for TypedSum { /// where min/max makes sense. #[derive(Clone, Default)] struct TypedMinMax { - strings: MinMax>, - str_len: MinMax, + strings: MinMax>, + str_len: MinMax, integers: MinMax, - floats: MinMax, - dates: MinMax, + floats: MinMax, + dates: MinMax, } impl TypedMinMax { diff --git a/src/cmd/table.rs b/src/cmd/table.rs index 9b42c9742..ca565524f 100644 --- a/src/cmd/table.rs +++ b/src/cmd/table.rs @@ -43,13 +43,13 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_width: usize, - flag_pad: usize, - flag_output: Option, + arg_input: Option, + flag_width: usize, + flag_pad: usize, + flag_output: Option, flag_delimiter: Option, - flag_align: Align, - flag_condense: Option, + flag_align: Align, + flag_condense: Option, } #[derive(Deserialize, Clone, Copy)] diff --git a/src/cmd/tojsonl.rs b/src/cmd/tojsonl.rs index 251ecd795..0fa6f234e 100644 --- a/src/cmd/tojsonl.rs +++ b/src/cmd/tojsonl.rs @@ -31,10 +31,10 @@ use crate::{ #[derive(Deserialize, Clone)] struct Args { - arg_input: Option, - flag_jobs: Option, + arg_input: Option, + flag_jobs: Option, flag_delimiter: Option, - flag_output: Option, + flag_output: Option, } pub fn run(argv: &[&str]) -> CliResult<()> { @@ -66,16 +66,16 @@ pub fn run(argv: &[&str]) -> CliResult<()> { }; // we're calling the schema command to infer data types and enums let schema_args = crate::cmd::schema::Args { - flag_enum_threshold: 3, // we only do three, as we're only inferring boolean based on enum - flag_strict_dates: false, + flag_enum_threshold: 3, // we only do three, as we're only inferring boolean based on enum + flag_strict_dates: false, flag_pattern_columns: crate::select::SelectColumns::parse("").unwrap(), flag_dates_whitelist: "none".to_string(), // json doesn't have a date type, so don't infer dates - flag_prefer_dmy: false, - flag_stdout: false, - flag_jobs: Some(util::njobs(args.flag_jobs)), - flag_no_headers: false, - flag_delimiter: args.flag_delimiter, - arg_input: args.arg_input.clone(), + flag_prefer_dmy: false, + flag_stdout: false, + flag_jobs: Some(util::njobs(args.flag_jobs)), + flag_no_headers: false, + flag_delimiter: args.flag_delimiter, + arg_input: args.arg_input.clone(), }; // build schema for each field by their inferred type, min/max value/length, and unique values let properties_map: Map = diff --git a/src/cmd/transpose.rs b/src/cmd/transpose.rs index c585b352d..5519c5e5c 100644 --- a/src/cmd/transpose.rs +++ b/src/cmd/transpose.rs @@ -35,8 +35,8 @@ use crate::{ #[derive(Deserialize)] struct Args { - arg_input: Option, - flag_output: Option, + arg_input: Option, + flag_output: Option, flag_delimiter: Option, flag_multipass: bool, } diff --git a/src/cmd/validate.rs b/src/cmd/validate.rs index 4851b394d..7c73c2e31 100644 --- a/src/cmd/validate.rs +++ b/src/cmd/validate.rs @@ -71,27 +71,27 @@ static NULL_TYPE: once_cell::sync::OnceCell = OnceCell::new(); #[allow(dead_code)] #[derive(Deserialize)] struct Args { - flag_fail_fast: bool, - flag_valid: Option, - flag_invalid: Option, - flag_json: bool, + flag_fail_fast: bool, + flag_valid: Option, + flag_invalid: Option, + flag_json: bool, flag_pretty_json: bool, - flag_jobs: Option, - flag_no_headers: bool, - flag_delimiter: Option, + flag_jobs: Option, + flag_no_headers: bool, + flag_delimiter: Option, flag_progressbar: bool, - arg_input: Option, - arg_json_schema: Option, + arg_input: Option, + arg_json_schema: Option, } #[derive(Serialize, Deserialize)] struct RFC4180Struct { delimiter_char: char, - header_row: bool, - quote_char: char, - num_records: u64, - num_fields: usize, - fields: Vec, + header_row: bool, + quote_char: char, + num_records: u64, + num_fields: usize, + fields: Vec, } pub fn run(argv: &[&str]) -> CliResult<()> { @@ -166,11 +166,11 @@ pub fn run(argv: &[&str]) -> CliResult<()> { let msg = if args.flag_json || args.flag_pretty_json { let rfc4180 = RFC4180Struct { delimiter_char: rconfig.get_delimiter() as char, - header_row: !rconfig.no_headers, - quote_char: rconfig.quote as char, - num_records: record_count, - num_fields: header_len, - fields: field_vec, + header_row: !rconfig.no_headers, + quote_char: rconfig.quote as char, + num_records: record_count, + num_fields: header_len, + fields: field_vec, }; if args.flag_pretty_json { diff --git a/src/config.rs b/src/config.rs index 3c4e550aa..edd636061 100644 --- a/src/config.rs +++ b/src/config.rs @@ -71,23 +71,23 @@ impl<'de> Deserialize<'de> for Delimiter { #[allow(clippy::struct_excessive_bools)] #[derive(Debug)] pub struct Config { - path: Option, // None implies - idx_path: Option, - select_columns: Option, - delimiter: u8, - pub no_headers: bool, - flexible: bool, - terminator: csv::Terminator, - pub quote: u8, - quote_style: csv::QuoteStyle, - double_quote: bool, - escape: Option, - quoting: bool, + path: Option, // None implies + idx_path: Option, + select_columns: Option, + delimiter: u8, + pub no_headers: bool, + flexible: bool, + terminator: csv::Terminator, + pub quote: u8, + quote_style: csv::QuoteStyle, + double_quote: bool, + escape: Option, + quoting: bool, pub preamble_rows: u64, - trim: csv::Trim, - autoindex: bool, - checkutf8: bool, - prefer_dmy: bool, + trim: csv::Trim, + autoindex: bool, + checkutf8: bool, + prefer_dmy: bool, } // Empty trait as an alias for Seek and Read that avoids auto trait errors diff --git a/src/index.rs b/src/index.rs index ab2de4c76..b1654a9d5 100644 --- a/src/index.rs +++ b/src/index.rs @@ -7,7 +7,7 @@ use crate::CliResult; /// Indexed composes a CSV reader with a simple random access index. pub struct Indexed { csv_rdr: csv::Reader, - idx: RandomAccessSimple, + idx: RandomAccessSimple, } impl ops::Deref for Indexed { diff --git a/src/main.rs b/src/main.rs index 6a09f844e..5fbf4a550 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,10 +132,10 @@ Options: #[derive(Deserialize)] struct Args { - arg_command: Option, - flag_list: bool, + arg_command: Option, + flag_list: bool, flag_envlist: bool, - flag_update: bool, + flag_update: bool, } fn main() -> QsvExitCode { diff --git a/src/maindp.rs b/src/maindp.rs index 64cd46f11..90d5b9b6e 100644 --- a/src/maindp.rs +++ b/src/maindp.rs @@ -66,8 +66,8 @@ Options: ); #[derive(Deserialize)] struct Args { - arg_command: Option, - flag_list: bool, + arg_command: Option, + flag_list: bool, flag_envlist: bool, } diff --git a/src/mainlite.rs b/src/mainlite.rs index 0e7ef2e96..1af0d15a7 100644 --- a/src/mainlite.rs +++ b/src/mainlite.rs @@ -86,10 +86,10 @@ Options: #[derive(Deserialize)] struct Args { - arg_command: Option, - flag_list: bool, + arg_command: Option, + flag_list: bool, flag_envlist: bool, - flag_update: bool, + flag_update: bool, } fn main() -> QsvExitCode { diff --git a/src/select.rs b/src/select.rs index 4b66d529f..587ba49e7 100644 --- a/src/select.rs +++ b/src/select.rs @@ -13,7 +13,7 @@ use serde::de::{Deserialize, Deserializer, Error}; #[derive(Clone)] pub struct SelectColumns { selectors: Vec, - invert: bool, + invert: bool, } impl SelectColumns { @@ -89,14 +89,14 @@ impl<'de> Deserialize<'de> for SelectColumns { struct SelectorParser { chars: Vec, - pos: usize, + pos: usize, } impl SelectorParser { fn new(s: &str) -> SelectorParser { SelectorParser { chars: s.chars().collect(), - pos: 0, + pos: 0, } } diff --git a/src/util.rs b/src/util.rs index 301f013c9..7775179d8 100644 --- a/src/util.rs +++ b/src/util.rs @@ -720,7 +720,7 @@ fn test_hw_survey() { #[cfg(feature = "apply")] pub struct ColumnNameParser { chars: Vec, - pos: usize, + pos: usize, } #[cfg(feature = "apply")] @@ -728,7 +728,7 @@ impl ColumnNameParser { pub fn new(s: &str) -> ColumnNameParser { ColumnNameParser { chars: s.chars().collect(), - pos: 0, + pos: 0, } } diff --git a/tests/workdir.rs b/tests/workdir.rs index 5772610f1..cf0668a4a 100644 --- a/tests/workdir.rs +++ b/tests/workdir.rs @@ -16,8 +16,8 @@ static QSV_INTEGRATION_TEST_DIR: &str = "xit"; static NEXT_ID: atomic::AtomicUsize = atomic::AtomicUsize::new(0); pub struct Workdir { - root: PathBuf, - dir: PathBuf, + root: PathBuf, + dir: PathBuf, flexible: bool, }