Skip to content

Commit

Permalink
Merge branch 'eza-community:main' into issue-653
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinvaneijk authored Oct 26, 2024
2 parents fcd623f + ab57f46 commit 2d3a12d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,32 @@ SPDX-License-Identifier: EUPL-1.2
-->
# Changelog

## [0.20.5] - 2024-10-25

### Bug Fixes

- Ensure nested tree parts align under item name
- Remove depricated `chrono` `from_timestamp_opt`

### Miscellaneous Tasks

- Update generated test files

### Build

- Bump libc from 0.2.159 to 0.2.161
- Chrono v0.4.34 -> v0.4.38

## [0.20.4] - 2024-10-18

### Bug Fixes

- Filetype, coloring for executables and folder

### Miscellaneous Tasks

- Eza v0.20.4 changelogs, version bump

## [0.20.3] - 2024-10-17

### Bug Fixes
Expand Down
10 changes: 5 additions & 5 deletions 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
Expand Up @@ -18,7 +18,7 @@ readme = "README.md"
homepage = "https://github.com/eza-community/eza"
license = "EUPL-1.2"
repository = "https://github.com/eza-community/eza"
version = "0.20.4"
version = "0.20.5"


[package.metadata.deb]
Expand Down
7 changes: 4 additions & 3 deletions src/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,11 @@ impl<'dir> File<'dir> {
fn systemtime_to_naivedatetime(st: SystemTime) -> Option<NaiveDateTime> {
let duration = st.duration_since(SystemTime::UNIX_EPOCH).ok()?;

// FIXME: NaiveDateTime::from_timestamp_opt is deprecated since chrono 0.4.35
NaiveDateTime::from_timestamp_opt(
DateTime::from_timestamp(
duration.as_secs().try_into().ok()?,
(duration.as_nanos() % 1_000_000_000).try_into().ok()?,
)
.map(|dt| dt.naive_local())
}

/// This file’s last modified timestamp, if available on this platform.
Expand All @@ -786,10 +786,11 @@ impl<'dir> File<'dir> {
};
}
let md = self.metadata();
NaiveDateTime::from_timestamp_opt(
DateTime::from_timestamp(
md.map_or(0, MetadataExt::ctime),
md.map_or(0, |md| md.ctime_nsec() as u32),
)
.map(|dt| dt.naive_local())
}

#[cfg(windows)]
Expand Down

0 comments on commit 2d3a12d

Please sign in to comment.