aboutsummaryrefslogtreecommitdiff
path: root/minecraft-chat/src/text_component.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-12-13 00:07:21 -0600
committermat <github@matdoes.dev>2021-12-13 00:07:21 -0600
commitc96ae8fce4e53ea9fad111ac7f479f2fa33ef859 (patch)
tree2d35061fa712464b225317f56a806d0dd269ca82 /minecraft-chat/src/text_component.rs
parent2c3bf3b79e133acd01580144771a7cf238ecc4ee (diff)
downloadazalea-drasl-c96ae8fce4e53ea9fad111ac7f479f2fa33ef859.tar.xz
start implementing joining servers
Diffstat (limited to 'minecraft-chat/src/text_component.rs')
-rw-r--r--minecraft-chat/src/text_component.rs4
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()));
}