Skip to content

Commit 6276978

Browse files
committed
fix usage of Timespec om the target hermit
1 parent 3435df2 commit 6276978

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/std/src/sys/hermit/time.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Timespec {
4040
}
4141

4242
fn checked_add_duration(&self, other: &Duration) -> Option<Timespec> {
43-
let mut secs = self.tv_sec.checked_add_unsigned(other.as_secs())?;
43+
let mut secs = self.t.tv_sec.checked_add_unsigned(other.as_secs())?;
4444

4545
// Nano calculations can't overflow because nanos are <1B which fit
4646
// in a u32.
@@ -53,7 +53,7 @@ impl Timespec {
5353
}
5454

5555
fn checked_sub_duration(&self, other: &Duration) -> Option<Timespec> {
56-
let mut secs = self.tv_sec.checked_sub_unsigned(other.as_secs())?;
56+
let mut secs = self.t.tv_sec.checked_sub_unsigned(other.as_secs())?;
5757

5858
// Similar to above, nanos can't overflow.
5959
let mut nsec = self.t.tv_nsec as i32 - other.subsec_nanos() as i32;

0 commit comments

Comments
 (0)