mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-01 13:29:06 +02:00
Fix 1.88.0 clippy warnings
This commit is contained in:
parent
ec4fd79864
commit
64e7375f2f
6 changed files with 14 additions and 17 deletions
|
@ -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(())
|
||||
}
|
||||
|
|
|
@ -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(())
|
||||
},
|
||||
)
|
||||
|
|
|
@ -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)?;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue