Skip to content

Commit

Permalink
apply rustfmt with StdExternalCrate group_imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Sep 29, 2022
1 parent f6d54b7 commit b7b42c0
Show file tree
Hide file tree
Showing 59 changed files with 312 additions and 222 deletions.
9 changes: 5 additions & 4 deletions src/cmd/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ Common options:
-p, --progressbar Show progress bars. Not valid for stdin.
"#;

use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::CliResult;
use crate::{regex_once_cell, util};
use cached::proc_macro::cached;
use censor::{Censor, Sex, Zealous};
use dynfmt::Format;
Expand All @@ -255,6 +251,11 @@ use titlecase::titlecase;
use vader_sentiment::SentimentIntensityAnalyzer;
use whatlang::detect;

use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::CliResult;
use crate::{regex_once_cell, util};

// number of CSV rows to process in a batch
const BATCH_SIZE: usize = 24_000;

Expand Down
3 changes: 2 additions & 1 deletion src/cmd/behead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ Common options:
Must be a single character. (default: ,)
";

use serde::Deserialize;

use crate::config::{Config, Delimiter};
use crate::util;
use crate::CliResult;
use serde::Deserialize;

#[derive(Deserialize)]
struct Args {
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ Common options:
Must be a single character. (default: ,)
";

use serde::Deserialize;

use crate::config::{Config, Delimiter};
use crate::util;
use crate::CliResult;
use serde::Deserialize;

#[derive(Deserialize)]
struct Args {
Expand Down
5 changes: 3 additions & 2 deletions src/cmd/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ Common options:
Must be a single character. (default: ,)
";

use log::{debug, info};
use serde::Deserialize;

use crate::config::{Config, Delimiter};
use crate::util;
use crate::CliResult;
use log::{debug, info};
use serde::Deserialize;

#[derive(Deserialize)]
struct Args {
Expand Down
11 changes: 6 additions & 5 deletions src/cmd/dedup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ Common options:
Must be a single character. (default: ,)
"#;

use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::util;
use crate::CliResult;
use std::cmp;

use csv::ByteRecord;
use rayon::prelude::*;
use serde::Deserialize;
use std::cmp;

use crate::cmd::sort::iter_cmp;
use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::util;
use crate::CliResult;
#[derive(Deserialize)]
struct Args {
arg_input: Option<String>,
Expand Down
5 changes: 3 additions & 2 deletions src/cmd/enumerate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ Common options:
Must be a single character. (default: ,)
"#;

use serde::Deserialize;
use uuid::Uuid;

use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::util;
use crate::CliResult;
use serde::Deserialize;
use uuid::Uuid;

const NULL_VALUE: &str = "<NULL>";

Expand Down
12 changes: 7 additions & 5 deletions src/cmd/excel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,18 @@ Common options:
-o, --output <file> Write output to <file> instead of stdout.
"#;

use crate::config::Config;
use crate::util;
use crate::CliResult;
use std::cmp;
use std::path::PathBuf;

use calamine::{open_workbook_auto, DataType, Range, Reader};
use log::{debug, info};
use serde::Deserialize;
use std::cmp;
use std::path::PathBuf;
use thousands::Separable;

use crate::config::Config;
use crate::util;
use crate::CliResult;

#[derive(Deserialize)]
struct Args {
arg_input: String,
Expand Down
18 changes: 10 additions & 8 deletions src/cmd/exclude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,22 @@ Common options:
Must be a single character. (default: ,)
";

use crate::config::{Config, Delimiter};
use crate::index::Indexed;
use crate::select::{SelectColumns, Selection};
use crate::util;
use crate::CliResult;
use ahash::AHashMap;
use byteorder::{BigEndian, WriteBytesExt};
use serde::Deserialize;
use std::collections::hash_map::Entry;
use std::fmt;
use std::fs;
use std::io;
use std::str;

use ahash::AHashMap;
use byteorder::{BigEndian, WriteBytesExt};
use serde::Deserialize;

use crate::config::{Config, Delimiter};
use crate::index::Indexed;
use crate::select::{SelectColumns, Selection};
use crate::util;
use crate::CliResult;

type ByteString = Vec<u8>;

#[derive(Deserialize)]
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/explode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ Common options:
Must be a single character. (default: ,)
";

use serde::Deserialize;

use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::util;
use crate::CliResult;
use serde::Deserialize;
#[derive(Deserialize)]
struct Args {
arg_column: SelectColumns,
Expand Down
10 changes: 6 additions & 4 deletions src/cmd/extsort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ Common options:
appear as the header row in the output.
";

use crate::util;
use crate::CliResult;
use ext_sort::{buffer::mem::MemoryLimitedBufferBuilder, ExternalSorter, ExternalSorterBuilder};
use serde::Deserialize;
use std::fs;
use std::io::{self, prelude::*};
use std::path;

use ext_sort::{buffer::mem::MemoryLimitedBufferBuilder, ExternalSorter, ExternalSorterBuilder};
use serde::Deserialize;
use sysinfo::{System, SystemExt};

use crate::util;
use crate::CliResult;

#[derive(Deserialize)]
struct Args {
arg_input: String,
Expand Down
14 changes: 8 additions & 6 deletions src/cmd/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,8 @@ Common options:
-p, --progressbar Show progress bars. Not valid for stdin.
"#;

use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::CliError;
use crate::CliResult;
use crate::{regex_once_cell, util};
use std::{fs, thread, time};

use cached::proc_macro::{cached, io_cached};
use cached::{Cached, IOCached, RedisCache, Return};
use dynfmt::Format;
Expand All @@ -188,9 +185,14 @@ use regex::Regex;
use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
use serde::{Deserialize, Serialize};
use serde_json::json;
use std::{fs, thread, time};
use url::Url;

use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::CliError;
use crate::CliResult;
use crate::{regex_once_cell, util};

#[derive(Deserialize, Debug)]
struct Args {
flag_url_template: Option<String>,
Expand Down
16 changes: 9 additions & 7 deletions src/cmd/fetchpost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,8 @@ Common options:
-p, --progressbar Show progress bars. Not valid for stdin.
"#;

use crate::cmd::fetch::apply_jql;
use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::util;
use crate::CliError;
use crate::CliResult;
use std::{fs, thread, time};

use cached::proc_macro::{cached, io_cached};
use cached::{Cached, IOCached, RedisCache, Return};
use governor::{
Expand All @@ -164,9 +160,15 @@ use regex::Regex;
use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
use std::{fs, thread, time};
use url::Url;

use crate::cmd::fetch::apply_jql;
use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::util;
use crate::CliError;
use crate::CliResult;

#[derive(Deserialize, Debug)]
struct Args {
flag_new_column: Option<String>,
Expand Down
12 changes: 7 additions & 5 deletions src/cmd/fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ Common options:
Must be a single character. (default: ,)
";

use std::io;
use std::iter;
use std::ops;

use ahash::AHashMap;
use serde::Deserialize;

use crate::config::{Config, Delimiter};
use crate::select::{SelectColumns, Selection};
use crate::util;
use crate::CliResult;
use ahash::AHashMap;
use serde::Deserialize;
use std::io;
use std::iter;
use std::ops;

type ByteString = Vec<u8>;
type BoxedWriter = csv::Writer<Box<dyn io::Write + 'static>>;
Expand Down
6 changes: 4 additions & 2 deletions src/cmd/fixlengths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ Common options:
Must be a single character. (default: ,)
";

use std::cmp;

use serde::Deserialize;

use crate::config::{Config, Delimiter};
use crate::util;
use crate::CliResult;
use serde::Deserialize;
use std::cmp;

#[derive(Deserialize)]
struct Args {
Expand Down
10 changes: 6 additions & 4 deletions src/cmd/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ Common options:
Must be a single character. (default: ,)
";

use crate::config::{Config, Delimiter};
use crate::util;
use crate::CliResult;
use serde::Deserialize;
use std::borrow::Cow;
use std::io::{self, Write};

use serde::Deserialize;
use tabwriter::TabWriter;

use crate::config::{Config, Delimiter};
use crate::util;
use crate::CliResult;

#[derive(Deserialize)]
struct Args {
arg_input: Option<String>,
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ Common options:
Must be a single character. (default: ,)
";

use serde::Deserialize;

use crate::config::{Config, Delimiter};
use crate::util;
use crate::CliResult;
use serde::Deserialize;

#[derive(Deserialize)]
struct Args {
Expand Down
16 changes: 9 additions & 7 deletions src/cmd/foreach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@ Common options:
-p, --progressbar Show progress bars. Not valid for stdin.
";

use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::util;
use crate::CliResult;
use indicatif::{ProgressBar, ProgressDrawTarget};
use regex::bytes::{NoExpand, Regex};
use serde::Deserialize;
use std::ffi::OsStr;
use std::io::BufReader;
use std::os::unix::ffi::OsStrExt;
use std::process::{Command, Stdio};

use indicatif::{ProgressBar, ProgressDrawTarget};
use regex::bytes::{NoExpand, Regex};
use serde::Deserialize;

use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::util;
use crate::CliResult;

#[derive(Deserialize)]
struct Args {
arg_column: SelectColumns,
Expand Down
12 changes: 7 additions & 5 deletions src/cmd/frequency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ Common options:
Must be a single character. (default: ,)
";

use std::fs;
use std::io;

use serde::Deserialize;
use stats::{merge_all, Frequencies};
use threadpool::ThreadPool;

use crate::config::{Config, Delimiter};
use crate::index::Indexed;
use crate::select::{SelectColumns, Selection};
use crate::util;
use crate::CliResult;
use serde::Deserialize;
use stats::{merge_all, Frequencies};
use std::fs;
use std::io;
use threadpool::ThreadPool;

#[derive(Clone, Deserialize)]
pub struct Args {
Expand Down
Loading

0 comments on commit b7b42c0

Please sign in to comment.