Skip to content

Commit

Permalink
chore: chang all PathBuf default fmt to display
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkLoc committed Apr 27, 2024
1 parent fc250e3 commit c0d3e8a
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xtab"
version = "0.0.5"
version = "0.0.6"
authors = ["sharkLoc <[email protected]>"]
edition = "2021"
homepage = "https://github.com/sharkLoc/xtab"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cargo b --release

```bash
xtab -- CSV command line utilities
Version: 0.0.5
Version: 0.0.6

Authors: sharkLoc <[email protected]>
Source code: https://github.com/sharkLoc/xtab.git
Expand Down
2 changes: 1 addition & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use clap::{value_parser, Parser};
#[command(
name = "xtab",
author = "sharkLoc",
version = "0.0.5",
version = "0.0.6",
next_line_help = false,
about = "CSV command line utilities",
long_about = "A simple and cross-platform program for CSV file manipulation"
Expand Down
2 changes: 1 addition & 1 deletion src/command/addheader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn addheader_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}
info!("new header is: {}", new_header);
Expand Down
2 changes: 1 addition & 1 deletion src/command/csv2xlsx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn csv_xlsx(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
4 changes: 2 additions & 2 deletions src/command/dim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn dim_csv(
.from_reader(file_reader(csv.as_ref())?);

match &csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand All @@ -41,7 +41,7 @@ pub fn dim_csv(
let mut out_writer = file_writer(csvo.as_ref(), compression_level)?;

let buf = if let Some(file) = csv {
format!("file\trows\tcols\n{:?}\t{}\t{}\n", file, row, col.unwrap())
format!("file\trows\tcols\n{}\t{}\t{}\n", file.display(), row, col.unwrap())
} else {
format!("file\trows\tcols\n-\t{}\t{}\n", row, col.unwrap())
};
Expand Down
2 changes: 1 addition & 1 deletion src/command/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn drop_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn flatten_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/freq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn freq_csv(
std::process::exit(1);
}
match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn head_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn pretty_csv(
.from_reader(file_reader(csv.as_ref())?);

match &csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub fn replace_csv(
}

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/reverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn reverse_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn sample_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}
info!("rand seed is: {}", seed);
Expand Down
2 changes: 1 addition & 1 deletion src/command/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn search_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn slice_csv(
std::process::exit(1);
}
match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/tail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn tail_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}
let mut recs = vec![];
Expand Down
2 changes: 1 addition & 1 deletion src/command/transpose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn transpose_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/uniq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn uniq_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn view_csv(
.from_reader(file_reader(csv.as_ref())?);

match csv {
Some(csv) => info!("read file from: {:?}", csv),
Some(csv) => info!("read file from: {}", csv.display()),
None => info!("read file from stdin "),
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/xlsx2csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn xlsx_csv(
let start = Instant::now();

match &xlsx {
Some(x) => info!("read file from: {:?}", x),
Some(x) => info!("read file from: {}", x.display()),
None => {
error!("xlsx file not provided");
std::process::exit(1);
Expand Down

0 comments on commit c0d3e8a

Please sign in to comment.