We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2be151b commit 05fe57eCopy full SHA for 05fe57e
uefi/src/result/error.rs
@@ -54,5 +54,19 @@ impl<Data: Debug> Display for Error<Data> {
54
}
55
56
57
+impl<Data: Debug> Error<Data> {
58
+ /// Transforms the generic payload of an error to `()`. This is useful if
59
+ /// you want
60
+ /// - to retain the erroneous status code,
61
+ /// - do not care about the payload, and
62
+ /// - refrain from generic type complexity in a higher API level.
63
+ pub fn to_err_without_payload(&self) -> Error<()> {
64
+ Error {
65
+ status: self.status,
66
+ data: (),
67
+ }
68
69
+}
70
+
71
#[cfg(feature = "unstable")]
72
impl<Data: Debug> core::error::Error for Error<Data> {}
0 commit comments