1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +03:00

Upgrade chrono and replace deprecated methods usage

This commit is contained in:
Quentin Gliech
2024-03-18 14:00:38 +01:00
parent f543a8bd40
commit 61a69f5af4
32 changed files with 103 additions and 85 deletions

View File

@@ -66,9 +66,9 @@ impl Clock for SystemClock {
/// let t2 = clock.now();
/// assert_eq!(t1, t2);
///
/// clock.advance(Duration::seconds(10));
/// clock.advance(Duration::microseconds(10 * 1000 * 1000));
/// let t3 = clock.now();
/// assert_eq!(t2 + Duration::seconds(10), t3);
/// assert_eq!(t2 + Duration::microseconds(10 * 1000 * 1000), t3);
/// ```
pub struct MockClock {
timestamp: AtomicI64,
@@ -121,9 +121,9 @@ mod tests {
assert_eq!(first, second);
// Clock can be advanced by a fixed duration
clock.advance(Duration::seconds(10));
clock.advance(Duration::microseconds(10 * 1000 * 1000));
let third = clock.now();
assert_eq!(first + Duration::seconds(10), third);
assert_eq!(first + Duration::microseconds(10 * 1000 * 1000), third);
}
#[test]