Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
10 lines
502 B
Rust
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()
|
|
}
|