Skip to content

Commit 03e00b1

Browse files
committed
fix(lazer): is_multiple_of
1 parent 4a8e1b1 commit 03e00b1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lazer/sdk/rust/protocol/src/time.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl TimestampUs {
131131
pub fn is_multiple_of(self, duration: DurationUs) -> bool {
132132
match self.0.checked_rem(duration.0) {
133133
Some(rem) => rem == 0,
134-
None => false,
134+
None => true,
135135
}
136136
}
137137

@@ -361,7 +361,7 @@ impl DurationUs {
361361
pub fn is_multiple_of(self, other: DurationUs) -> bool {
362362
match self.0.checked_rem(other.0) {
363363
Some(rem) => rem == 0,
364-
None => false,
364+
None => true,
365365
}
366366
}
367367

lazer/sdk/rust/protocol/src/time/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ fn timestamp_ops() {
152152
);
153153
assert_eq!(
154154
TimestampUs::from_micros(400).is_multiple_of(DurationUs::from_micros(0)),
155-
false
155+
true
156156
);
157157
assert_eq!(
158158
TimestampUs::from_micros(400)
@@ -202,7 +202,7 @@ fn duration_ops() {
202202
);
203203
assert_eq!(
204204
DurationUs::from_micros(400).is_multiple_of(DurationUs::from_micros(0)),
205-
false
205+
true
206206
);
207207

208208
assert_eq!(

0 commit comments

Comments
 (0)