File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -307,17 +307,16 @@ impl Duration {
307307 Duration { secs, nanos : subsec_nanos }
308308 }
309309
310-
311310 /// Creates a new Duration from the specified number of nanoseconds.
312- ///
313- /// # Panics
311+ ///
312+ /// # Panics
314313 ///
315314 /// Panics if the given number of weeks overflows the `Duration` size.
316- /// Use this function if you need to specify time greater than what can fit in u64
315+ /// Use this function if you need to specify time greater than what can fit in u64
317316 /// (around 584 years).
318- ///
319- /// # Examples
320- ///
317+ ///
318+ /// # Examples
319+ ///
321320 /// ```
322321 /// #![feature(duration_from_nanos_u128)]
323322 /// use std::time::Duration;
@@ -329,14 +328,14 @@ impl Duration {
329328 #[ inline]
330329 pub const fn from_nanos_u128 ( nanos : u128 ) -> Duration {
331330 const NANOS_PER_SEC : u128 = self :: NANOS_PER_SEC as u128 ;
332- let secs : u64 = ( nanos/ NANOS_PER_SEC ) as u64 ;
331+ let secs: u64 = ( nanos / NANOS_PER_SEC ) as u64 ;
333332 let subsec_nanos = ( nanos % NANOS_PER_SEC ) as u32 ;
334333 // SAFETY: x % 1_000_000_000 < 1_000_000_000
335334 let subsec_nanos = unsafe { Nanoseconds :: new_unchecked ( subsec_nanos) } ;
336335
337336 Duration { secs, nanos : subsec_nanos }
338337 }
339-
338+
340339 /// Creates a new `Duration` from the specified number of weeks.
341340 ///
342341 /// # Panics
You can’t perform that action at this time.
0 commit comments