Skip to content

Commit

Permalink
remove checkutf8
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Feb 17, 2023
1 parent 7d0b455 commit 569eba0
Show file tree
Hide file tree
Showing 38 changed files with 6 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/cmd/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
// .checkutf8(false)
.select(args.arg_column);

let mut rdr = rconfig.reader()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/applydp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
.select(args.arg_column);

let mut rdr = rconfig.reader()?;
Expand Down
4 changes: 1 addition & 3 deletions src/cmd/behead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ struct Args {

pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
let conf = Config::new(&args.arg_input)
.checkutf8(false)
.no_headers(false);
let conf = Config::new(&args.arg_input).no_headers(false);

let mut rdr = conf.reader()?;
let mut wtr = Config::new(&args.flag_output).writer()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ struct Args {
pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
let conf = Config::new(&args.arg_input)
.checkutf8(false)
.no_headers(args.flag_no_headers)
// we also want to count the quotes when computing width
.quoting(!args.flag_width)
Expand Down
1 change: 0 additions & 1 deletion src/cmd/dedup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
.select(args.flag_select);

let mut rdr = rconfig.reader()?;
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ pub fn run(argv: &[&str]) -> CliResult<()> {

let rconfig_left = Config::new(&args.arg_input_left)
.delimiter(args.flag_delimiter_left)
.checkutf8(false)
.no_headers(args.flag_no_headers_left);

let rconfig_right = Config::new(&args.arg_input_right)
.delimiter(args.flag_delimiter_right)
.checkutf8(false)
.no_headers(args.flag_no_headers_right);

if rconfig_left.is_stdin() || rconfig_right.is_stdin() {
Expand Down
1 change: 0 additions & 1 deletion src/cmd/enumerate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
let mut rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.checkutf8(false)
.no_headers(args.flag_no_headers);

let mut rdr = rconfig.reader()?;
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/exclude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,10 @@ impl Args {
let rconf1 = Config::new(&Some(self.arg_input1.clone()))
.delimiter(self.flag_delimiter)
.no_headers(self.flag_no_headers)
.checkutf8(false)
.select(self.arg_columns1.clone());
let rconf2 = Config::new(&Some(self.arg_input2.clone()))
.delimiter(self.flag_delimiter)
.no_headers(self.flag_no_headers)
.checkutf8(false)
.select(self.arg_columns2.clone());

let mut rdr1 = rconf1.reader_file()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let mut rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.trim(csv::Trim::All)
.checkutf8(false)
.no_headers(args.flag_no_headers);

let mut rdr = rconfig.reader()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/fetchpost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let mut rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.trim(csv::Trim::All)
.checkutf8(false)
.no_headers(args.flag_no_headers);

let mut rdr = rconfig.reader()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
.select(args.arg_selection);

let wconfig = Config::new(&args.flag_output);
Expand Down
1 change: 0 additions & 1 deletion src/cmd/fixlengths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ struct Args {
pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
let config = Config::new(&args.arg_input)
.checkutf8(false)
.delimiter(args.flag_delimiter)
.no_headers(true)
.flexible(true);
Expand Down
1 change: 0 additions & 1 deletion src/cmd/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.checkutf8(false)
.no_headers(args.flag_no_headers);
let mut rdr = rconfig.reader()?;
let headers = rdr.byte_headers()?.clone();
Expand Down
1 change: 0 additions & 1 deletion src/cmd/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;

let rconfig = Config::new(&args.arg_input)
.checkutf8(false)
.delimiter(args.flag_delimiter)
.no_headers(true);
let mut wconfig = Config::new(&args.flag_output)
Expand Down
1 change: 0 additions & 1 deletion src/cmd/foreach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
.select(args.arg_column);

let mut rdr = rconfig.reader()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/frequency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ impl Args {
Config::new(&self.arg_input)
.delimiter(self.flag_delimiter)
.no_headers(self.flag_no_headers)
.checkutf8(false)
.select(self.flag_select.clone())
}

Expand Down
4 changes: 1 addition & 3 deletions src/cmd/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ struct Args {

pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
let conf = Config::new(&args.arg_input)
.checkutf8(false)
.delimiter(args.flag_delimiter);
let conf = Config::new(&args.arg_input).delimiter(args.flag_delimiter);

let tdir = temp_dir();
let mut dsp = DataSampleParser::new();
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
Some(p) => PathBuf::from(&p),
};

let rconfig = Config::new(&Some(args.arg_input)).checkutf8(false);
let rconfig = Config::new(&Some(args.arg_input));
let mut rdr = rconfig.reader_file()?;
let mut wtr = io::BufWriter::new(fs::File::create(pidx)?);
RandomAccessSimple::create(&mut rdr, &mut wtr)?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
std::env::set_var("QSV_SNIFF_PREAMBLE", "1");
}
let mut rconfig = Config::new(&args.arg_input)
.checkutf8(false)
.delimiter(args.flag_delimiter)
.no_headers(true)
.quote(args.flag_quote.as_byte())
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,10 @@ impl Args {
let rconf1 = Config::new(&Some(self.arg_input1.clone()))
.delimiter(self.flag_delimiter)
.no_headers(self.flag_no_headers)
.checkutf8(false)
.select(self.arg_columns1.clone());
let rconf2 = Config::new(&Some(self.arg_input2.clone()))
.delimiter(self.flag_delimiter)
.no_headers(self.flag_no_headers)
.checkutf8(false)
.select(self.arg_columns2.clone());

let mut rdr1 = rconf1.reader_file_stdin()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/luau.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.checkutf8(false)
.no_headers(args.flag_no_headers);

let mut rdr = rconfig.reader()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ impl Args {
Config::new(&self.arg_input)
.delimiter(self.flag_delimiter)
.no_headers(self.flag_no_headers)
.checkutf8(false)
.select(self.arg_column.clone())
}

Expand Down
1 change: 0 additions & 1 deletion src/cmd/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;

let rconfig = Config::new(&args.arg_input)
.checkutf8(false)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers);

Expand Down
1 change: 0 additions & 1 deletion src/cmd/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
.select(args.flag_select);

let mut rdr = rconfig.reader()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/reverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ struct Args {
pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
let rconfig = Config::new(&args.arg_input)
.checkutf8(false)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers);

Expand Down
4 changes: 1 addition & 3 deletions src/cmd/safenames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
.map(str::to_lowercase)
.collect();

let rconfig = Config::new(&args.arg_input)
.checkutf8(true)
.delimiter(args.flag_delimiter);
let rconfig = Config::new(&args.arg_input).delimiter(args.flag_delimiter);

let mut rdr = rconfig.reader()?;
let mut wtr = Config::new(&args.flag_output).writer()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {

let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.checkutf8(false)
.no_headers(args.flag_no_headers);

let mut sample_size = args.arg_sample_size;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
.select(args.flag_select);

let mut rdr = rconfig.reader()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/searchset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
debug!("Successfully compiled regex set!");

let rconfig = Config::new(&args.arg_input)
.checkutf8(false)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.select(args.flag_select);
Expand Down
1 change: 0 additions & 1 deletion src/cmd/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
.select(args.arg_selection);

let mut rdr = rconfig.reader()?;
Expand Down
3 changes: 1 addition & 2 deletions src/cmd/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct Args {

pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
match args.rconfig().checkutf8(false).indexed()? {
match args.rconfig().indexed()? {
None => args.no_index(),
Some(idxed) => args.with_index(idxed),
}
Expand Down Expand Up @@ -111,7 +111,6 @@ impl Args {

fn rconfig(&self) -> Config {
Config::new(&self.arg_input)
.checkutf8(false)
.delimiter(self.flag_delimiter)
.no_headers(self.flag_no_headers)
}
Expand Down
1 change: 0 additions & 1 deletion src/cmd/sniff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {

let conf = Config::new(&args.arg_input)
.flexible(true)
.checkutf8(false)
.delimiter(args.flag_delimiter);
let n_rows = util::count_rows(&conf)?;

Expand Down
1 change: 0 additions & 1 deletion src/cmd/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
.select(args.flag_select);

// we're loading the entire file into memory, we need to check avail mem
Expand Down
1 change: 0 additions & 1 deletion src/cmd/sortcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(args.flag_no_headers)
.checkutf8(false)
.select(args.flag_select);

let mut rdr = rconfig.reader()?;
Expand Down
1 change: 0 additions & 1 deletion src/cmd/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ impl Args {

fn rconfig(&self) -> Config {
Config::new(&self.arg_input)
.checkutf8(false)
.delimiter(self.flag_delimiter)
.no_headers(self.flag_no_headers)
}
Expand Down
1 change: 0 additions & 1 deletion src/cmd/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let rconfig = Config::new(&args.arg_input)
.delimiter(args.flag_delimiter)
.no_headers(true)
.checkutf8(false)
.flexible(true);
let wconfig = Config::new(&args.flag_output).delimiter(Some(Delimiter(b'\t')));

Expand Down
1 change: 0 additions & 1 deletion src/cmd/transpose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ impl Args {

fn rconfig(&self) -> Config {
Config::new(&self.arg_input)
.checkutf8(false)
.delimiter(self.flag_delimiter)
.no_headers(true)
}
Expand Down
1 change: 0 additions & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ pub fn many_configs(
Config::new(&Some(p))
.delimiter(delim)
.no_headers(no_headers)
.checkutf8(false)
})
.collect::<Vec<_>>();
errif_greater_one_stdin(&confs)?;
Expand Down

0 comments on commit 569eba0

Please sign in to comment.