File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ impl Duration {
277277 #[ unstable( feature = "duration_as_u128" , issue = "50202" ) ]
278278 #[ inline]
279279 pub fn as_millis ( & self ) -> u128 {
280- self . secs as u128 * MILLIS_PER_SEC as u128 + self . nanos as u128 / NANOS_PER_MILLI as u128
280+ self . secs as u128 * MILLIS_PER_SEC as u128 + ( self . nanos / NANOS_PER_MILLI ) as u128
281281 }
282282
283283 /// Returns the total number of microseconds contained by this `Duration`.
@@ -294,7 +294,7 @@ impl Duration {
294294 #[ unstable( feature = "duration_as_u128" , issue = "50202" ) ]
295295 #[ inline]
296296 pub fn as_micros ( & self ) -> u128 {
297- self . secs as u128 * MICROS_PER_SEC as u128 + self . nanos as u128 / NANOS_PER_MICRO as u128
297+ self . secs as u128 * MICROS_PER_SEC as u128 + ( self . nanos / NANOS_PER_MICRO ) as u128
298298 }
299299
300300 /// Returns the total number of nanoseconds contained by this `Duration`.
You can’t perform that action at this time.
0 commit comments