From 1a961d968b80b720ef2d3900c0b95e1c16a0089e Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 26 Dec 2021 14:17:01 -0600 Subject: fix some clippy warnings --- azalea-protocol/src/mc_buf.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'azalea-protocol/src/mc_buf.rs') 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(&mut self, list: &Vec, writer: F) -> Result<(), std::io::Error> + fn write_list(&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 { - fn write_list(&mut self, list: &Vec, writer: F) -> Result<(), std::io::Error> + fn write_list(&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, String> { -- cgit v1.2.3