Skip to content

Commit cd32e16

Browse files
edward-shenmeta-codesync[bot]
authored andcommitted
Replace Duration::from_secs(7200) to Duration::from_hours(2) (#2067)
Summary: Pull Request resolved: #2067 Rust 1.91 introduced `Duration::from_hours`. This diff replaces some instances of `Duration::from_secs` with the corresponding `Duration::from_hours`. Reviewed By: dtolnay Differential Revision: D88441307 fbshipit-source-id: 3186fae5d60b3710b9ddc9cbf59c0bbecd5dd699
1 parent c604e7e commit cd32e16

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

monarch_conda/src/diff.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ mod tests {
440440
let base_timestamp = 1640995200;
441441
let test_base_time = UNIX_EPOCH + Duration::from_secs(base_timestamp);
442442
let old_time = test_base_time - Duration::from_hours(1); // 1 hour before base
443-
let new_time = test_base_time + Duration::from_secs(7200); // 2 hours after base (beyond slop)
443+
let new_time = test_base_time + Duration::from_hours(2); // 2 hours after base (beyond slop)
444444

445445
// Files older than base should be considered equal
446446
assert_eq!(comparator(&old_time, &old_time), std::cmp::Ordering::Equal);
@@ -739,7 +739,7 @@ mod tests {
739739
let base_timestamp = base_time.duration_since(UNIX_EPOCH)?.as_secs();
740740
let update_window_time = UNIX_EPOCH + Duration::from_secs(base_timestamp + 3630); // In the middle of update window
741741
let old_time = base_time - Duration::from_hours(1);
742-
let new_time = base_time + Duration::from_secs(7200);
742+
let new_time = base_time + Duration::from_hours(2);
743743

744744
// When update_window_time is the first arg (env1 context with update window),
745745
// it should be treated as equal to old files
@@ -815,7 +815,7 @@ mod tests {
815815
let comparator = CondaFingerprint::mtime_comparator(&fingerprint1, &fingerprint2)?;
816816

817817
let old_time = base_time - Duration::from_hours(1);
818-
let new_time = base_time + Duration::from_secs(7200);
818+
let new_time = base_time + Duration::from_hours(2);
819819

820820
// Basic mtime comparison should still work
821821
assert_eq!(comparator(&old_time, &old_time), std::cmp::Ordering::Equal);
@@ -929,7 +929,7 @@ mod tests {
929929
let comparator = CondaFingerprint::mtime_comparator(&fingerprint1, &fingerprint2)?;
930930

931931
let old_time = base_time - Duration::from_hours(1);
932-
let new_time = base_time + Duration::from_secs(7200);
932+
let new_time = base_time + Duration::from_hours(2);
933933

934934
assert_eq!(comparator(&old_time, &old_time), std::cmp::Ordering::Equal);
935935
assert_eq!(

0 commit comments

Comments
 (0)