aboutsummaryrefslogtreecommitdiff
path: root/azalea-buf/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-12-11 23:21:42 -1030
committermat <git@matdoes.dev>2025-12-11 23:21:42 -1030
commitca70e5e321a3c174c53d0650feed84db471ac30d (patch)
tree43042fa40c2f3d7f30ea56e1ee84c59dcb13be66 /azalea-buf/src
parent918214e8ba4eae65daf5d2da17aa0022f2ae5212 (diff)
downloadazalea-drasl-ca70e5e321a3c174c53d0650feed84db471ac30d.tar.xz
enable str_to_string clippy lint
Diffstat (limited to 'azalea-buf/src')
-rw-r--r--azalea-buf/src/lib.rs8
-rw-r--r--azalea-buf/src/read.rs4
2 files changed, 6 insertions, 6 deletions
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<String,
lossy: String::from_utf8_lossy(buffer).to_string(),
// backtrace: Backtrace::capture(),
})?
- .to_string();
+ .to_owned();
if string.len() > 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<Self, BufReadError> {
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())),
}
}
}