Skip to content

Commit

Permalink
apply struct_field_align_threshold = 20 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Sep 30, 2022
1 parent fdcc933 commit f66ff86
Show file tree
Hide file tree
Showing 55 changed files with 535 additions and 535 deletions.
32 changes: 16 additions & 16 deletions src/cmd/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
flag_rename: Option<String>,
flag_comparand: String,
cmd_geocode: bool,
arg_input: Option<String>,
flag_rename: Option<String>,
flag_comparand: String,
flag_replacement: String,
flag_prefer_dmy: bool,
flag_formatstr: String,
flag_jobs: Option<usize>,
flag_new_column: Option<String>,
flag_output: Option<String>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
flag_prefer_dmy: bool,
flag_formatstr: String,
flag_jobs: Option<usize>,
flag_new_column: Option<String>,
flag_output: Option<String>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
flag_progressbar: bool,
}

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/behead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use crate::{

#[derive(Deserialize)]
struct Args {
arg_input: Option<String>,
arg_input: Option<String>,
flag_delimiter: Option<Delimiter>,
flag_output: Option<String>,
flag_output: Option<String>,
}

pub fn run(argv: &[&str]) -> CliResult<()> {
Expand Down
12 changes: 6 additions & 6 deletions src/cmd/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ use crate::{

#[derive(Deserialize)]
struct Args {
cmd_rows: bool,
cmd_columns: bool,
arg_input: Vec<String>,
flag_pad: bool,
flag_output: Option<String>,
cmd_rows: bool,
cmd_columns: bool,
arg_input: Vec<String>,
flag_pad: bool,
flag_output: Option<String>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
flag_delimiter: Option<Delimiter>,
}

pub fn run(argv: &[&str]) -> CliResult<()> {
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ use crate::{

#[derive(Deserialize)]
struct Args {
arg_input: Option<String>,
arg_input: Option<String>,
flag_human_readable: bool,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
}

pub fn run(argv: &[&str]) -> CliResult<()> {
Expand Down
18 changes: 9 additions & 9 deletions src/cmd/dedup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ use crate::{
};
#[derive(Deserialize)]
struct Args {
arg_input: Option<String>,
flag_select: SelectColumns,
flag_no_case: bool,
flag_sorted: bool,
flag_dupes_output: Option<String>,
flag_output: Option<String>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
arg_input: Option<String>,
flag_select: SelectColumns,
flag_no_case: bool,
flag_sorted: bool,
flag_dupes_output: Option<String>,
flag_output: Option<String>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
flag_human_readable: bool,
flag_jobs: Option<usize>,
flag_jobs: Option<usize>,
}

pub fn run(argv: &[&str]) -> CliResult<()> {
Expand Down
12 changes: 6 additions & 6 deletions src/cmd/enumerate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ const NULL_VALUE: &str = "<NULL>";

#[derive(Deserialize)]
struct Args {
arg_input: Option<String>,
arg_input: Option<String>,
flag_new_column: Option<String>,
flag_constant: Option<String>,
flag_copy: Option<SelectColumns>,
flag_uuid: bool,
flag_output: Option<String>,
flag_constant: Option<String>,
flag_copy: Option<SelectColumns>,
flag_uuid: bool,
flag_output: Option<String>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
flag_delimiter: Option<Delimiter>,
}

pub fn run(argv: &[&str]) -> CliResult<()> {
Expand Down
12 changes: 6 additions & 6 deletions src/cmd/excel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
flag_output: Option<String>,
}

pub fn run(argv: &[&str]) -> CliResult<()> {
Expand Down
32 changes: 16 additions & 16 deletions src/cmd/exclude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ type ByteString = Vec<u8>;

#[derive(Deserialize)]
struct Args {
arg_columns1: SelectColumns,
arg_input1: String,
arg_columns2: SelectColumns,
arg_input2: String,
flag_v: bool,
flag_output: Option<String>,
arg_columns1: SelectColumns,
arg_input1: String,
arg_columns2: SelectColumns,
arg_input2: String,
flag_v: bool,
flag_output: Option<String>,
flag_no_headers: bool,
flag_no_case: bool,
flag_delimiter: Option<Delimiter>,
flag_no_case: bool,
flag_delimiter: Option<Delimiter>,
}

pub fn run(argv: &[&str]) -> CliResult<()> {
Expand All @@ -68,13 +68,13 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
}

struct IoState<R, W: io::Write> {
wtr: csv::Writer<W>,
rdr1: csv::Reader<R>,
sel1: Selection,
rdr2: csv::Reader<R>,
sel2: Selection,
wtr: csv::Writer<W>,
rdr1: csv::Reader<R>,
sel1: Selection,
rdr2: csv::Reader<R>,
sel2: Selection,
no_headers: bool,
casei: bool,
casei: bool,
}

impl<R: io::Read + io::Seek, W: io::Write> IoState<R, W> {
Expand Down Expand Up @@ -164,8 +164,8 @@ impl Args {
#[allow(dead_code)]
struct ValueIndex<R> {
// This maps tuples of values to corresponding rows.
values: AHashMap<Vec<ByteString>, Vec<usize>>,
idx: Indexed<R, io::Cursor<Vec<u8>>>,
values: AHashMap<Vec<ByteString>, Vec<usize>>,
idx: Indexed<R, io::Cursor<Vec<u8>>>,
num_rows: usize,
}

Expand Down
12 changes: 6 additions & 6 deletions src/cmd/explode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ use crate::{
};
#[derive(Deserialize)]
struct Args {
arg_column: SelectColumns,
arg_separator: String,
arg_input: Option<String>,
flag_rename: Option<String>,
flag_output: Option<String>,
arg_column: SelectColumns,
arg_separator: String,
arg_input: Option<String>,
flag_rename: Option<String>,
flag_output: Option<String>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
flag_delimiter: Option<Delimiter>,
}

pub fn replace_column_value(
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/extsort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ use crate::{util, CliResult};

#[derive(Deserialize)]
struct Args {
arg_input: String,
arg_output: String,
flag_jobs: Option<usize>,
arg_input: String,
arg_output: String,
flag_jobs: Option<usize>,
flag_no_headers: bool,
}

Expand Down
78 changes: 39 additions & 39 deletions src/cmd/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,27 +203,27 @@ use crate::{
#[derive(Deserialize, Debug)]
struct Args {
flag_url_template: Option<String>,
flag_new_column: Option<String>,
flag_jql: Option<String>,
flag_jqlfile: Option<String>,
flag_pretty: bool,
flag_rate_limit: u32,
flag_timeout: u64,
flag_http_header: Vec<String>,
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<String>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
flag_progressbar: bool,
arg_url_column: SelectColumns,
arg_input: Option<String>,
flag_new_column: Option<String>,
flag_jql: Option<String>,
flag_jqlfile: Option<String>,
flag_pretty: bool,
flag_rate_limit: u32,
flag_timeout: u64,
flag_http_header: Vec<String>,
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<String>,
flag_no_headers: bool,
flag_delimiter: Option<Delimiter>,
flag_progressbar: bool,
arg_url_column: SelectColumns,
arg_input: Option<String>,
}

// connect to Redis at localhost, using database 1 by default when --redis is enabled
Expand All @@ -244,34 +244,34 @@ impl From<reqwest::Error> 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<RedisConfig> = Lazy::new(RedisConfig::load);
Expand Down Expand Up @@ -543,29 +543,29 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
#[allow(unused_assignments)]
let mut intermediate_redis_value: Return<String> = Return {
was_cached: false,
value: String::new(),
value: String::new(),
};
#[allow(unused_assignments)]
let mut intermediate_value: Return<FetchResponse> = 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;
Expand Down Expand Up @@ -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,
};
}
};
Expand Down
Loading

0 comments on commit f66ff86

Please sign in to comment.