We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50c7344 commit e1777f9Copy full SHA for e1777f9
library/std/src/sys/hermit/time.rs
@@ -40,7 +40,7 @@ impl Timespec {
40
}
41
42
fn checked_add_duration(&self, other: &Duration) -> Option<Timespec> {
43
- let mut secs = self.tv_sec.checked_add_unsigned(other.as_secs())?;
+ let mut secs = self.t.tv_sec.checked_add_unsigned(other.as_secs())?;
44
45
// Nano calculations can't overflow because nanos are <1B which fit
46
// in a u32.
@@ -53,7 +53,7 @@ impl Timespec {
53
54
55
fn checked_sub_duration(&self, other: &Duration) -> Option<Timespec> {
56
- let mut secs = self.tv_sec.checked_sub_unsigned(other.as_secs())?;
+ let mut secs = self.t.tv_sec.checked_sub_unsigned(other.as_secs())?;
57
58
// Similar to above, nanos can't overflow.
59
let mut nsec = self.t.tv_nsec as i32 - other.subsec_nanos() as i32;
0 commit comments