aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/base
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-09-11 00:09:56 -0700
committerGitHub <noreply@github.com>2024-09-11 07:09:56 +0000
commitbc8d8b62c3017dbdb413a636b80bc3a2df0172d6 (patch)
tree2f4de6402a0bfc56af023b4611bfe14fc59f8fa8 /components/shared/base
parent095590e2247517cf22e4aea7956f341a9a38b206 (diff)
downloadservo-bc8d8b62c3017dbdb413a636b80bc3a2df0172d6.tar.gz
servo-bc8d8b62c3017dbdb413a636b80bc3a2df0172d6.zip
Stop using `time@0.1` in Servo (#33394)
This removes the last few uses of `time@0.1` in Servo. There are still dependencies from `style` and `webrender`, but they will be removed soon as well. The uses of this version of `time` are replaced with `std::time` types and `time@0.3` when negative `Duration` is necessary. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/shared/base')
-rw-r--r--components/shared/base/cross_process_instant.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/shared/base/cross_process_instant.rs b/components/shared/base/cross_process_instant.rs
index aa504b8b389..9c5652b835c 100644
--- a/components/shared/base/cross_process_instant.rs
+++ b/components/shared/base/cross_process_instant.rs
@@ -61,6 +61,16 @@ impl Add<Duration> for CrossProcessInstant {
}
}
+impl Sub<Duration> for CrossProcessInstant {
+ type Output = Self;
+
+ fn sub(self, rhs: Duration) -> Self::Output {
+ Self {
+ value: self.value - rhs.whole_nanoseconds() as u64,
+ }
+ }
+}
+
#[cfg(all(unix, not(any(target_os = "macos", target_os = "ios"))))]
mod platform {
use libc::timespec;