aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/mc_buf
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-protocol/src/mc_buf')
-rwxr-xr-xazalea-protocol/src/mc_buf/read.rs6
-rwxr-xr-xazalea-protocol/src/mc_buf/write.rs8
2 files changed, 7 insertions, 7 deletions
diff --git a/azalea-protocol/src/mc_buf/read.rs b/azalea-protocol/src/mc_buf/read.rs
index 68c9cb3f..e1ae321c 100755
--- a/azalea-protocol/src/mc_buf/read.rs
+++ b/azalea-protocol/src/mc_buf/read.rs
@@ -1,10 +1,10 @@
-use super::{BitSet, UnsizedByteArray, MAX_STRING_LENGTH};
+use super::{UnsizedByteArray, MAX_STRING_LENGTH};
use azalea_chat::component::Component;
use azalea_core::{
difficulty::Difficulty, game_type::GameType, resource_location::ResourceLocation,
serializable_uuid::SerializableUuid, BlockPos, Direction, Slot, SlotData,
};
-use byteorder::{ReadBytesExt, WriteBytesExt, BE};
+use byteorder::{ReadBytesExt, BE};
use serde::Deserialize;
use std::io::Read;
use tokio::io::{AsyncRead, AsyncReadExt};
@@ -421,7 +421,7 @@ impl McBufReadable for Component {
fn read_into(buf: &mut impl Read) -> Result<Self, String> {
let string = buf.read_utf()?;
let json: serde_json::Value = serde_json::from_str(string.as_str())
- .map_err(|e| "Component isn't valid JSON".to_string())?;
+ .map_err(|_| "Component isn't valid JSON".to_string())?;
let component = Component::deserialize(json).map_err(|e| e.to_string())?;
Ok(component)
}
diff --git a/azalea-protocol/src/mc_buf/write.rs b/azalea-protocol/src/mc_buf/write.rs
index 34bcafeb..3a4a02f8 100755
--- a/azalea-protocol/src/mc_buf/write.rs
+++ b/azalea-protocol/src/mc_buf/write.rs
@@ -20,8 +20,8 @@ pub trait Writable: Write {
Ok(())
}
- fn write_int_id_list(&mut self, list: &Vec<i32>) -> Result<(), std::io::Error> {
- self.write_list(&list, |buf, n| buf.write_varint(*n))
+ fn write_int_id_list(&mut self, list: &[i32]) -> Result<(), std::io::Error> {
+ self.write_list(list, |buf, n| buf.write_varint(*n))
}
fn write_map<KF, VF, KT, VT>(
@@ -47,7 +47,7 @@ pub trait Writable: Write {
}
fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), std::io::Error> {
- self.write_all(bytes);
+ self.write_all(bytes)?;
Ok(())
}
@@ -333,7 +333,7 @@ impl McBufWritable for Component {
// let component = Component::deserialize(json).map_err(|e| e.to_string())?;
// Ok(component)
// }
- fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn write_into(&self, _buf: &mut impl Write) -> Result<(), std::io::Error> {
// component doesn't have serialize implemented yet
todo!()
}