Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved comments and error handling #1201

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading