diff options
Diffstat (limited to 'azalea-chat/src')
| -rwxr-xr-x | azalea-chat/src/component.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 872a0a5c..d307bcbc 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -1,3 +1,6 @@ +use std::io::{Read, Write}; + +use azalea_buf::{McBufReadable, McBufWritable}; use serde::{de, Deserialize, Deserializer}; use crate::{ @@ -267,7 +270,7 @@ impl<'de> Deserialize<'de> for Component { impl McBufReadable for Component { fn read_into(buf: &mut impl Read) -> Result<Self, String> { - let string = buf.read_utf()?; + let string = String::read_into(buf)?; let json: serde_json::Value = serde_json::from_str(string.as_str()) .map_err(|_| "Component isn't valid JSON".to_string())?; let component = Component::deserialize(json).map_err(|e| e.to_string())?; |
