Implementa Debug en comp./tipos principales

This commit is contained in:
Manuel Cillero 2026-03-21 11:26:02 +01:00
parent c3feff9efd
commit a0b14aec36
21 changed files with 61 additions and 32 deletions

View file

@ -62,6 +62,17 @@ pub struct L10n {
args: Vec<(CowStr, CowStr)>,
}
impl fmt::Debug for L10n {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("L10n")
.field("op", &self.op)
.field("args", &self.args)
// No se puede mostrar `locales`; se representa con un texto fijo.
.field("locales", &"<StaticLoader>")
.finish()
}
}
impl L10n {
/// **n** = *“native”*. Crea una instancia con una cadena literal sin traducción.
pub fn n(text: impl Into<CowStr>) -> Self {
@ -177,14 +188,3 @@ impl L10n {
PreEscaped(self.lookup(language).unwrap_or_default())
}
}
impl fmt::Debug for L10n {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("L10n")
.field("op", &self.op)
.field("args", &self.args)
// No se puede mostrar `locales`; se representa con un texto fijo.
.field("locales", &"<StaticLoader>")
.finish()
}
}