diff options
Diffstat (limited to 'azalea-chat/src/component.rs')
| -rwxr-xr-x | azalea-chat/src/component.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 81224d9f..12df03cd 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -267,16 +267,9 @@ impl From<String> for Component { impl Display for Component { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - // this contains the final string will all the ansi escape codes - for component in self.clone().into_iter() { - let component_text = match &component { - Self::Text(c) => c.text.to_string(), - Self::Translatable(c) => c.to_string(), - }; - - f.write_str(&component_text)?; + match self { + Component::Text(c) => c.fmt(f), + Component::Translatable(c) => c.fmt(f), } - - Ok(()) } } |
