feat(tazjin/german-string): add Debug implementation
Change-Id: I9a4a8a4815ac210c402cfc2feb1fe0606affb327 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12239 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
This commit is contained in:
parent
2284c00417
commit
ab6a4815ff
1 changed files with 7 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
use std::alloc::Layout;
|
use std::alloc::Layout;
|
||||||
|
use std::fmt::{Debug, Formatter};
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
@ -116,6 +117,12 @@ impl PartialEq for GermanString {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Debug for GermanString {
|
||||||
|
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
|
||||||
|
String::from_utf8_lossy(self.as_bytes()).fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
Loading…
Reference in a new issue