Skip to content

Commit

Permalink
improved comments and error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sharma-shray authored Oct 13, 2024
1 parent 97c1133 commit 425f38e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rayon-core/src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,20 @@ impl<T> JobResult<T> {
}
}

/// Convert the `JobResult` for a job that has finished (and hence
/// its JobResult is populated) into its return value.
/// Converts the `JobResult` for a finished job into its return value.
///
/// NB. This will panic if the job panicked.
/// # Panics
/// This will panic if the job resulted in a panic (`JobResult::Panic`).
pub(super) fn into_return_value(self) -> T {
match self {
JobResult::None => unreachable!(),
JobResult::None => unreachable!("JobResult should not be None after completion."),
JobResult::Ok(x) => x,
JobResult::Panic(x) => unwind::resume_unwinding(x),
}
}
}


/// Indirect queue to provide FIFO job priority.
pub(super) struct JobFifo {
inner: Injector<JobRef>,
Expand Down

0 comments on commit 425f38e

Please sign in to comment.