diff options
| author | mat <github@matdoes.dev> | 2021-12-13 00:07:21 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-13 00:07:21 -0600 |
| commit | c96ae8fce4e53ea9fad111ac7f479f2fa33ef859 (patch) | |
| tree | 2d35061fa712464b225317f56a806d0dd269ca82 /minecraft-chat | |
| parent | 2c3bf3b79e133acd01580144771a7cf238ecc4ee (diff) | |
| download | azalea-drasl-c96ae8fce4e53ea9fad111ac7f479f2fa33ef859.tar.xz | |
start implementing joining servers
Diffstat (limited to 'minecraft-chat')
| -rw-r--r-- | minecraft-chat/src/text_component.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/minecraft-chat/src/text_component.rs b/minecraft-chat/src/text_component.rs index a5030fa1..25341086 100644 --- a/minecraft-chat/src/text_component.rs +++ b/minecraft-chat/src/text_component.rs @@ -27,9 +27,7 @@ pub fn legacy_color_code_to_text_component(legacy_color_code: &str) -> TextCompo if legacy_color_code.chars().nth(i).unwrap() == LEGACY_FORMATTING_CODE_SYMBOL { let formatting_code = legacy_color_code.chars().nth(i + 1).unwrap(); if let Ok(formatter) = ChatFormatting::from_code(formatting_code) { - if components.is_empty() { - components.push(TextComponent::new("".to_string())); - } else if !components.last().unwrap().text.is_empty() { + if components.is_empty() || !components.last().unwrap().text.is_empty() { components.push(TextComponent::new("".to_string())); } |
