Skip to content

Commit 72b40be

Browse files
authored
Use Integer::div_floor explicitly
rust-lang/rust#88581 adds several new integer methods as inherent impls. These new methods are a breaking change accepted as a minor change. They already cause build failures with nightly and will eventually cause build failures with stable as well, unless rust-lang changes course. This uses `Integer::div_floor` explicitly to avoid accidentally calling the new nightly methods, same as done for rust-num/num-bigint#218.
1 parent 0b32a89 commit 72b40be

File tree

1 file changed

+1
-1
lines changed
  • rust-runtime/smithy-types/src/instant

1 file changed

+1
-1
lines changed

rust-runtime/smithy-types/src/instant/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl Instant {
147147
/// This is fallible since `Instant` holds more precision than an `i64`, and will
148148
/// return a `ConversionError` for `Instant` values that can't be converted.
149149
pub fn to_epoch_millis(&self) -> Result<i64, ConversionError> {
150-
let subsec_millis = i64::from(self.subsecond_nanos).div_floor(&(NANOS_PER_MILLI as i64));
150+
let subsec_millis = Integer::div_floor(&i64::from(self.subsecond_nanos), &(NANOS_PER_MILLI as i64));
151151
if self.seconds < 0 {
152152
self.seconds
153153
.checked_add(1)

0 commit comments

Comments
 (0)