Skip to content

Commit

Permalink
Style refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Felle33 committed Jan 22, 2025
1 parent 78f6fb0 commit 2d7652a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 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 src/uu/date/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
for date in dates {
match date {
Ok(date) => {
let format_string = custom_time_format(&format_string);
let format_string = custom_time_format(format_string);
// Refuse to pass this string to chrono as it is crashing in this crate
if format_string.contains("%#z") {
return Err(USimpleError::new(
Expand Down
1 change: 0 additions & 1 deletion src/uu/ls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ path = "src/ls.rs"
[dependencies]
ansi-width = { workspace = true }
chrono = { workspace = true }
chrono-tz = { workspace = true }
clap = { workspace = true, features = ["env"] }
glob = { workspace = true }
hostname = { workspace = true }
Expand Down
8 changes: 3 additions & 5 deletions src/uu/ls/src/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,9 @@ impl TimeStyle {
//So it's not yet implemented
(Self::Locale, true) => time.format("%b %e %H:%M").to_string(),
(Self::Locale, false) => time.format("%b %e %Y").to_string(),
(Self::Format(fmt), _) => {
// this line can be replaced with the one in timzone_date.rs
time.format(custom_tz_fmt::custom_time_format(fmt).as_str())
.to_string()
}
(Self::Format(fmt), _) => time
.format(custom_tz_fmt::custom_time_format(fmt).as_str())
.to_string(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ path = "src/lib/lib.rs"

[dependencies]
chrono = { workspace = true }
chrono-tz = {workspace = true}
chrono-tz = { workspace = true }
clap = { workspace = true }
uucore_procs = { workspace = true }
number_prefix = { workspace = true }
Expand Down

0 comments on commit 2d7652a

Please sign in to comment.