diff options
author | Dylan Reid <dgreid@chromium.org> | 2019-03-07 16:16:42 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-28 11:17:12 -0700 |
commit | 681d1ff584a816890c026cb9c8ab7d52ece19040 (patch) | |
tree | b9dac634b9fa43bb8aa6e38e44964bf6654fdd72 /sys_util | |
parent | b3d382c942784ec818387de24257c56fd5a2bf81 (diff) | |
download | crosvm-681d1ff584a816890c026cb9c8ab7d52ece19040.tar crosvm-681d1ff584a816890c026cb9c8ab7d52ece19040.tar.gz crosvm-681d1ff584a816890c026cb9c8ab7d52ece19040.tar.bz2 crosvm-681d1ff584a816890c026cb9c8ab7d52ece19040.tar.lz crosvm-681d1ff584a816890c026cb9c8ab7d52ece19040.tar.xz crosvm-681d1ff584a816890c026cb9c8ab7d52ece19040.tar.zst crosvm-681d1ff584a816890c026cb9c8ab7d52ece19040.zip |
sys_util: clock: Make clippy clean
Signed-off-by: Dylan Reid <dgreid@chromium.org> Change-Id: I321af88908e14af08886fdfe5191bde5335c247a Reviewed-on: https://chromium-review.googlesource.com/1510432 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org>
Diffstat (limited to 'sys_util')
-rw-r--r-- | sys_util/src/clock.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys_util/src/clock.rs b/sys_util/src/clock.rs index 35e28a7..09bcd0a 100644 --- a/sys_util/src/clock.rs +++ b/sys_util/src/clock.rs @@ -26,6 +26,12 @@ impl Clock { } } +impl Default for Clock { + fn default() -> Self { + Self::new() + } +} + const NS_PER_SEC: u64 = 1_000_000_000; /// A fake clock that can be used in tests to give exact control over the time. /// For a code example, see the tests in sys_util/src/timerfd.rs. @@ -38,7 +44,7 @@ pub struct FakeClock { impl FakeClock { pub fn new() -> Self { FakeClock { - ns_since_epoch: 1547163599 * NS_PER_SEC, + ns_since_epoch: 1_547_163_599 * NS_PER_SEC, deadlines: Vec::new(), } } @@ -82,3 +88,9 @@ impl FakeClock { }); } } + +impl Default for FakeClock { + fn default() -> Self { + Self::new() + } +} |