diff options
| author | Nemo157 <github@nemo157.com> | 2023-01-20 22:31:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-20 15:31:02 -0600 |
| commit | 1059afa6fcf8b2776fd25dac07ed2e76ab48bed3 (patch) | |
| tree | 8e5976e6d0a3baf4fdb87010f9ab5f0c375ecca6 /azalea-chat/src/component.rs | |
| parent | c6b566497220ce5801d21ee2149d6a4b273aa2d1 (diff) | |
| download | azalea-drasl-1059afa6fcf8b2776fd25dac07ed2e76ab48bed3.tar.xz | |
Allow using azalea-chat without azalea-buf to avoid unstable features (#58)
Diffstat (limited to 'azalea-chat/src/component.rs')
| -rwxr-xr-x | azalea-chat/src/component.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index d889f3ef..14ec0d0c 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -4,6 +4,7 @@ use crate::{ text_component::TextComponent, translatable_component::{StringOrComponent, TranslatableComponent}, }; +#[cfg(feature = "azalea-buf")] use azalea_buf::{BufReadError, McBufReadable, McBufWritable}; use log::debug; use once_cell::sync::Lazy; @@ -266,6 +267,7 @@ impl<'de> Deserialize<'de> for Component { } } +#[cfg(feature = "azalea-buf")] impl McBufReadable for Component { fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { let string = String::read_from(buf)?; @@ -276,6 +278,7 @@ impl McBufReadable for Component { } } +#[cfg(feature = "azalea-buf")] impl McBufWritable for Component { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { let json = serde_json::to_string(self).unwrap(); |
