aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/mc_buf.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-12-26 14:17:01 -0600
committermat <github@matdoes.dev>2021-12-26 14:17:01 -0600
commit1a961d968b80b720ef2d3900c0b95e1c16a0089e (patch)
treef7d5a23e6832a539a3fdf0364bb80f825973ce07 /azalea-protocol/src/mc_buf.rs
parentaf28b0e57aeeca8790e3014f3e568c60ae892e39 (diff)
downloadazalea-drasl-1a961d968b80b720ef2d3900c0b95e1c16a0089e.tar.xz
fix some clippy warnings
Diffstat (limited to 'azalea-protocol/src/mc_buf.rs')
-rw-r--r--azalea-protocol/src/mc_buf.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea-protocol/src/mc_buf.rs b/azalea-protocol/src/mc_buf.rs
index 04857235..538fc212 100644
--- a/azalea-protocol/src/mc_buf.rs
+++ b/azalea-protocol/src/mc_buf.rs
@@ -13,7 +13,7 @@ const MAX_STRING_LENGTH: u16 = 32767;
#[async_trait]
pub trait Writable {
- fn write_list<F, T>(&mut self, list: &Vec<T>, writer: F) -> Result<(), std::io::Error>
+ fn write_list<F, T>(&mut self, list: &[T], writer: F) -> Result<(), std::io::Error>
where
F: FnOnce(&mut Self, &T) -> Result<(), std::io::Error> + Copy,
T: Sized,
@@ -49,7 +49,7 @@ pub trait Writable {
#[async_trait]
impl Writable for Vec<u8> {
- fn write_list<F, T>(&mut self, list: &Vec<T>, writer: F) -> Result<(), std::io::Error>
+ fn write_list<F, T>(&mut self, list: &[T], writer: F) -> Result<(), std::io::Error>
where
F: FnOnce(&mut Self, &T) -> Result<(), std::io::Error> + Copy,
Self: Sized,
@@ -215,7 +215,7 @@ where
}
return i;
}
- return 5;
+ 5
}
fn get_varlong_size(&mut self, value: i32) -> u8 {
@@ -225,7 +225,7 @@ where
}
return i;
}
- return 10;
+ 10
}
async fn read_byte_array(&mut self) -> Result<Vec<u8>, String> {