-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Something we can have like unwrap, that instead of panic will call vc_terminate_xxxx. Consider this code:
let init_frame: PhysFrame = match mem_allocate_frames(init_count) {
Some(f) => f,
None => vc_terminate_svsm_enomem(),
};from something generic resembling:
pub trait CustomUnwrap<T> {
fn unwrap_svsm_enomem(self) -> T;
}
impl CustomUnwrap<T> for Option<T> {
fn unwrap_svsm_enomem(self) -> T {
match self {
Some(value) => value,
None => vc_terminate_svsm_enomem(),
}
}
}Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested