1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

Merge pull request #8214 from deadmeu/move-comment

ls: move recent time threshold comment
This commit is contained in:
Sylvestre Ledru 2025-06-18 10:48:53 +02:00 committed by GitHub
commit 407d97c68f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -273,7 +273,6 @@ enum TimeStyle {
/// Whether the given date is considered recent (i.e., in the last 6 months). /// Whether the given date is considered recent (i.e., in the last 6 months).
fn is_recent(time: Timestamp, state: &mut ListState) -> bool { fn is_recent(time: Timestamp, state: &mut ListState) -> bool {
// According to GNU a Gregorian year has 365.2425 * 24 * 60 * 60 == 31556952 seconds on the average.
time > state.recent_time_threshold time > state.recent_time_threshold
} }
@ -2080,6 +2079,7 @@ pub fn list(locs: Vec<&Path>, config: &Config) -> UResult<()> {
uid_cache: HashMap::new(), uid_cache: HashMap::new(),
#[cfg(unix)] #[cfg(unix)]
gid_cache: HashMap::new(), gid_cache: HashMap::new(),
// According to GNU a Gregorian year has 365.2425 * 24 * 60 * 60 == 31556952 seconds on the average.
recent_time_threshold: Timestamp::now() - Duration::new(31_556_952 / 2, 0), recent_time_threshold: Timestamp::now() - Duration::new(31_556_952 / 2, 0),
}; };