From ca70e5e321a3c174c53d0650feed84db471ac30d Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 11 Dec 2025 23:21:42 -1030 Subject: enable str_to_string clippy lint --- azalea-buf/src/lib.rs | 8 ++++---- azalea-buf/src/read.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'azalea-buf/src') diff --git a/azalea-buf/src/lib.rs b/azalea-buf/src/lib.rs index ef3bd3a8..966b1372 100644 --- a/azalea-buf/src/lib.rs +++ b/azalea-buf/src/lib.rs @@ -161,7 +161,7 @@ mod tests { #[test] fn test_list() { - let original_vec = vec!["a".to_string(), "bc".to_string(), "def".to_string()]; + let original_vec = vec!["a".to_owned(), "bc".to_owned(), "def".to_owned()]; let mut buf = Vec::new(); original_vec.azalea_write(&mut buf).unwrap(); @@ -184,9 +184,9 @@ mod tests { #[test] fn test_map() { let original_map = HashMap::from([ - ("a".to_string(), 1), - ("bc".to_string(), 23), - ("def".to_string(), 456), + ("a".to_owned(), 1), + ("bc".to_owned(), 23), + ("def".to_owned(), 456), ]); let mut buf = Vec::new(); original_map.azalea_write_var(&mut buf).unwrap(); diff --git a/azalea-buf/src/read.rs b/azalea-buf/src/read.rs index 95dc79ac..a906c8c1 100644 --- a/azalea-buf/src/read.rs +++ b/azalea-buf/src/read.rs @@ -103,7 +103,7 @@ fn read_utf_with_len(buf: &mut Cursor<&[u8]>, max_length: u32) -> Result length as usize { return Err(BufReadError::StringLengthTooLong { length, max_length }); } @@ -422,7 +422,7 @@ impl AzaleaRead for simdnbt::owned::NbtCompound { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result { match simdnbt::owned::read_tag(buf).map_err(simdnbt::Error::from)? { simdnbt::owned::NbtTag::Compound(compound) => Ok(compound), - _ => Err(BufReadError::Custom("Expected compound tag".to_string())), + _ => Err(BufReadError::Custom("Expected compound tag".to_owned())), } } } -- cgit v1.2.3