Fix 1.88.0 clippy warnings

This commit is contained in:
Matthias Schiffer 2025-06-29 17:05:59 +02:00
parent ec4fd79864
commit 64e7375f2f
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
6 changed files with 14 additions and 17 deletions

View file

@ -20,7 +20,7 @@ fn main() -> Result<()> {
let args = Args::parse();
let value: fastnbt::Value = minedmap_nbt::data::from_file(args.file.as_path())?;
println!("{:#x?}", value);
println!("{value:#x?}");
Ok(())
}

View file

@ -21,7 +21,7 @@ fn main() -> Result<()> {
minedmap_nbt::region::from_file(args.file.as_path())?.foreach_chunk(
|coords, value: fastnbt::Value| {
println!("Chunk {:?}: {:#x?}", coords, value);
println!("Chunk {coords:?}: {value:#x?}");
Ok(())
},
)

View file

@ -124,7 +124,7 @@ impl<R: Read + Seek> Region<R> {
let mut len_buf = [0u8; 4];
reader
.read_exact(&mut len_buf)
.with_context(|| format!("Failed to read length for chunk {:?}", coords))?;
.with_context(|| format!("Failed to read length for chunk {coords:?}"))?;
let byte_len = u32::from_be_bytes(len_buf) as usize;
if byte_len < 1 || byte_len > (len as usize) * BLOCKSIZE - 4 {
bail!("Invalid length for chunk {:?}", coords);
@ -133,9 +133,9 @@ impl<R: Read + Seek> Region<R> {
let mut buffer = vec![0; byte_len];
reader
.read_exact(&mut buffer)
.with_context(|| format!("Failed to read data for chunk {:?}", coords))?;
.with_context(|| format!("Failed to read data for chunk {coords:?}"))?;
let chunk = decode_chunk(&buffer)
.with_context(|| format!("Failed to decode data for chunk {:?}", coords))?;
.with_context(|| format!("Failed to decode data for chunk {coords:?}"))?;
f(coords, chunk)?;
}