Skip to content

Commit

Permalink
use standard Ok(flush) idiom
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Jan 10, 2024
1 parent 4a03705 commit c10932b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cmd/jsonl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,5 @@ Use `tojsonl` command to convert _to_ jsonl instead of _from_ jsonl."#,
wtr.write_record(&record)?;
}

Ok(())
Ok(wtr.flush()?)
}
1 change: 1 addition & 0 deletions src/cmd/partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ impl Args {
} else {
wtr.write_byte_record(&row)?;
}
wtr.flush()?;
}
Ok(())
}
Expand Down
3 changes: 1 addition & 2 deletions src/cmd/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
while rdr.read_byte_record(&mut record)? {
wtr.write_record(&record)?;
}
wtr.flush()?;
Ok(())
Ok(wtr.flush()?)
}

pub fn rename_headers_all_generic(num_of_cols: usize) -> String {
Expand Down
3 changes: 1 addition & 2 deletions src/cmd/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ impl Args {
for r in idx.byte_records().take(end - start) {
wtr.write_byte_record(&r?)?;
}
wtr.flush()?;
Ok(())
Ok(wtr.flush()?)
}

fn range(&self) -> Result<(usize, usize), String> {
Expand Down
3 changes: 1 addition & 2 deletions src/cmd/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,5 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
.map(|f| util::condense(Cow::Borrowed(f), args.flag_condense)),
)?;
}
wtr.flush()?;
Ok(())
Ok(wtr.flush()?)
}

0 comments on commit c10932b

Please sign in to comment.