diff options
| author | mat <github@matdoes.dev> | 2022-05-03 18:20:24 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-05-03 18:20:24 +0000 |
| commit | c9878129274258a30dc3ee0ecbd064b4fcf9bc6e (patch) | |
| tree | 07e03b13eb71b4231159d42b5773e31371e83858 /azalea-protocol/src/mc_buf | |
| parent | 477c367fc44a2b5c139845f7e8307c6c276d95ee (diff) | |
| download | azalea-drasl-c9878129274258a30dc3ee0ecbd064b4fcf9bc6e.tar.xz | |
clippy
Diffstat (limited to 'azalea-protocol/src/mc_buf')
| -rwxr-xr-x | azalea-protocol/src/mc_buf/read.rs | 6 | ||||
| -rwxr-xr-x | azalea-protocol/src/mc_buf/write.rs | 8 |
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!() } |
