We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5c972c7 + 51602d1 commit f37f469Copy full SHA for f37f469
uefi/src/data_types/owned_strs.rs
@@ -15,6 +15,22 @@ pub enum FromStrError {
15
InteriorNul,
16
}
17
18
+impl fmt::Display for FromStrError {
19
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
20
+ write!(
21
+ f,
22
+ "UCS-2 Conversion Error: {}",
23
+ match self {
24
+ Self::InvalidChar => "Invalid character",
25
+ Self::InteriorNul => "Interior null terminator",
26
+ }
27
+ )
28
29
+}
30
+
31
+#[cfg(feature = "unstable")]
32
+impl core::error::Error for FromStrError {}
33
34
/// An owned UCS-2 null-terminated string.
35
///
36
/// For convenience, a [CString16] is comparable with `&str` and `String` from the standard library
0 commit comments