Skip to content

Commit 9c99093

Browse files
nicholasbishopGabrielMajeri
authored andcommitted
Impl Display for CString16
1 parent a08aebe commit 9c99093

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/data_types/owned_strs.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use super::chars::{Char16, NUL_16};
22
use super::strs::CStr16;
33
use crate::alloc_api::vec::Vec;
44
use core::convert::TryFrom;
5+
use core::fmt;
56
use core::ops;
67

78
/// Error returned by [`CString16::try_from::<&str>`].
@@ -71,6 +72,12 @@ impl AsRef<CStr16> for CString16 {
7172
}
7273
}
7374

75+
impl fmt::Display for CString16 {
76+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
77+
self.as_ref().fmt(f)
78+
}
79+
}
80+
7481
#[cfg(test)]
7582
mod tests {
7683
use super::*;

0 commit comments

Comments
 (0)