Files
leleka/crates/cuda-driver/src/closed_kernels_gpu/failure.rs
T

10 lines
502 B
Rust

//! Folds a primary driver failure and the outcome of the mandatory context restore into one ExperimentalError,
//! so no restore error is lost behind the first one.
use super::{DriverResult, Error, ExperimentalError, combine};
/// A primary driver failure plus the outcome of the mandatory context restore.
pub(super) fn failure(primary: Error, restore: DriverResult<()>) -> ExperimentalError {
combine::<()>(Err(primary), restore).expect_err("a primary failure always stays an error").into()
}