diff options
Diffstat (limited to 'azalea-chat/src')
| -rw-r--r--[-rwxr-xr-x] | azalea-chat/src/text_component.rs | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | azalea-chat/src/translatable_component.rs | 6 |
2 files changed, 3 insertions, 3 deletions
diff --git a/azalea-chat/src/text_component.rs b/azalea-chat/src/text_component.rs index 96eef08e..96eef08e 100755..100644 --- a/azalea-chat/src/text_component.rs +++ b/azalea-chat/src/text_component.rs diff --git a/azalea-chat/src/translatable_component.rs b/azalea-chat/src/translatable_component.rs index 750f65c4..918c2c42 100755..100644 --- a/azalea-chat/src/translatable_component.rs +++ b/azalea-chat/src/translatable_component.rs @@ -59,7 +59,7 @@ impl TranslatableComponent { .args .get(matched) .cloned() - .unwrap_or(StringOrComponent::String("".to_string())); + .unwrap_or_else(|| StringOrComponent::String("".to_string())); components.push(TextComponent::new(built_text.clone())); built_text.clear(); @@ -107,7 +107,7 @@ impl TranslatableComponent { Ok(TextComponent { base: BaseComponent { - siblings: components.into_iter().map(|c| Component::Text(c)).collect(), + siblings: components.into_iter().map(Component::Text).collect(), style: Style::default(), }, text: "".to_string(), @@ -135,7 +135,7 @@ impl Display for StringOrComponent { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), fmt::Error> { match self { StringOrComponent::String(s) => write!(f, "{}", s), - StringOrComponent::Component(c) => write!(f, "{}", c.to_string()), + StringOrComponent::Component(c) => write!(f, "{}", c), } } } |
