diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-08-04 20:43:10 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-04 20:43:10 -0500 |
| commit | 23b7f20a0d88b54d430820baeb4a6da0316a009a (patch) | |
| tree | f3e780515b3bbb9973d2b94338be6194b5ec0af3 /azalea-chat/src/component.rs | |
| parent | 827d943c3f27c65724ff83689b40c87d1cd1838c (diff) | |
| download | azalea-drasl-23b7f20a0d88b54d430820baeb4a6da0316a009a.tar.xz | |
Default components (#232)
* add default components
* remove debug prints
* clippy
* use default components
* fix tests
Diffstat (limited to 'azalea-chat/src/component.rs')
| -rw-r--r-- | azalea-chat/src/component.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 1cb2bf30..2a7e588e 100644 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -587,6 +587,16 @@ impl From<&str> for FormattedText { Self::from(s.to_string()) } } +impl From<TranslatableComponent> for FormattedText { + fn from(c: TranslatableComponent) -> Self { + FormattedText::Translatable(c) + } +} +impl From<TextComponent> for FormattedText { + fn from(c: TextComponent) -> Self { + FormattedText::Text(c) + } +} impl Display for FormattedText { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
