diff options
| author | mat <github@matdoes.dev> | 2021-12-08 22:09:24 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-08 22:09:24 +0000 |
| commit | 8bc1fd23991539eb8b01fc940b1219786ae5f32b (patch) | |
| tree | d544a4a5dca863c56ece143f201f07445e7cbf4a /minecraft-chat/src/text_component.rs | |
| parent | c16d55ccddd741057bf532bd946b2854dc208c65 (diff) | |
| download | azalea-drasl-8bc1fd23991539eb8b01fc940b1219786ae5f32b.tar.xz | |
minecraft-chat compiles
Diffstat (limited to 'minecraft-chat/src/text_component.rs')
| -rw-r--r-- | minecraft-chat/src/text_component.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/minecraft-chat/src/text_component.rs b/minecraft-chat/src/text_component.rs index 381befbb..a89264b2 100644 --- a/minecraft-chat/src/text_component.rs +++ b/minecraft-chat/src/text_component.rs @@ -1,13 +1,16 @@ -use crate::base_component::BaseComponent; +use crate::{base_component::BaseComponent, mutable_component::MutableComponent}; +#[derive(Clone)] pub struct TextComponent { + pub base: BaseComponent, pub text: String, } -impl TextComponent { - pub fn new(text: &str) -> TextComponent { - TextComponent { - text: text.to_string(), +impl<'a> TextComponent { + pub fn new(text: String) -> Self { + Self { + text: text, + base: BaseComponent::new(), } } |
