@@ -518,7 +518,7 @@ pub fn sleep(dur: Duration) {
518
518
/// # park and unpark
519
519
///
520
520
/// Every thread is equipped with some basic low-level blocking support, via the
521
- /// [`thread::park`][`park`] function and [`thread::Thread::unpark() `][`unpark`]
521
+ /// [`thread::park`][`park`] function and [`thread::Thread::unpark`][`unpark`]
522
522
/// method. [`park`] blocks the current thread, which can then be resumed from
523
523
/// another thread by calling the [`unpark`] method on the blocked thread's
524
524
/// handle.
@@ -555,6 +555,7 @@ pub fn sleep(dur: Duration) {
555
555
///
556
556
/// ```
557
557
/// use std::thread;
558
+ /// use std::time::Duration;
558
559
///
559
560
/// let parked_thread = thread::Builder::new()
560
561
/// .spawn(|| {
@@ -598,7 +599,7 @@ pub fn park() {
598
599
/// Blocks unless or until the current thread's token is made available or
599
600
/// the specified duration has been reached (may wake spuriously).
600
601
///
601
- /// The semantics of this function are equivalent to [`park() `][park] except
602
+ /// The semantics of this function are equivalent to [`park`][park] except
602
603
/// that the thread will be blocked for roughly no longer than `dur`. This
603
604
/// method should not be used for precise timing due to anomalies such as
604
605
/// preemption or platform differences that may not cause the maximum
@@ -617,7 +618,7 @@ pub fn park_timeout_ms(ms: u32) {
617
618
/// Blocks unless or until the current thread's token is made available or
618
619
/// the specified duration has been reached (may wake spuriously).
619
620
///
620
- /// The semantics of this function are equivalent to [`park() `][park] except
621
+ /// The semantics of this function are equivalent to [`park`][park] except
621
622
/// that the thread will be blocked for roughly no longer than `dur`. This
622
623
/// method should not be used for precise timing due to anomalies such as
623
624
/// preemption or platform differences that may not cause the maximum
@@ -780,7 +781,7 @@ impl Thread {
780
781
/// Atomically makes the handle's token available if it is not already.
781
782
///
782
783
/// Every thread is equipped with some basic low-level blocking support, via
783
- /// the [`park() `][park] function and the `unpark()` method. These can be
784
+ /// the [`park`][park] function and the `unpark()` method. These can be
784
785
/// used as a more CPU-efficient implementation of a spinlock.
785
786
///
786
787
/// See the [park documentation][park] for more details.
@@ -789,6 +790,7 @@ impl Thread {
789
790
///
790
791
/// ```
791
792
/// use std::thread;
793
+ /// use std::time::Duration;
792
794
///
793
795
/// let parked_thread = thread::Builder::new()
794
796
/// .spawn(|| {
0 commit comments