diff options
Diffstat (limited to 'azalea-chat/src')
| -rw-r--r-- | azalea-chat/src/component.rs | 4 | ||||
| -rw-r--r-- | azalea-chat/src/text_component.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 30b0ed9d..be95638d 100644 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -385,7 +385,7 @@ impl<'de> Deserialize<'de> for FormattedText { } let style = Style::deserialize(&json); - component.get_base_mut().style = Box::new(style); + *component.get_base_mut().style = style; return Ok(component); } @@ -601,7 +601,7 @@ impl FormattedText { let base_style = Style::from_compound(compound).ok()?; let new_style = &mut component.get_base_mut().style; - *new_style = Box::new(new_style.merged_with(&base_style)); + **new_style = new_style.merged_with(&base_style); Some(component) } diff --git a/azalea-chat/src/text_component.rs b/azalea-chat/src/text_component.rs index 0fa0cd6f..c21e2d46 100644 --- a/azalea-chat/src/text_component.rs +++ b/azalea-chat/src/text_component.rs @@ -146,7 +146,7 @@ impl TextComponent { FormattedText::Text(self) } pub fn with_style(mut self, style: Style) -> Self { - self.base.style = Box::new(style); + *self.base.style = style; self } } |
