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:
Vincent Ambo 2024-08-17 01:51:13 +03:00 committed by clbot
parent 2284c00417
commit ab6a4815ff

View file

@ -1,4 +1,5 @@
use std::alloc::Layout;
use std::fmt::{Debug, Formatter};
#[derive(Clone, Copy)]
#[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)]
mod tests {
use super::*;