Fix clippy warnings

This commit is contained in:
Matthias Schiffer 2023-01-27 23:01:01 +01:00
parent daa188eb1d
commit 3cdafa7be9
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 8 additions and 6 deletions

View file

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

View file

@ -12,7 +12,9 @@ struct Args {
fn main() -> Result<()> {
let args = Args::parse();
minedmap::io::region::from_file(&args.file)?.foreach_chunk(|coords, value: fastnbt::Value| {
minedmap::io::region::from_file(args.file.as_path())?.foreach_chunk(
|coords, value: fastnbt::Value| {
println!("Chunk {:?}: {:#x?}", coords, value);
})
},
)
}

View file

@ -51,11 +51,11 @@ where
let buf = &buf[..len];
let (format, buf) = buf.split_at(1);
if format.get(0) != Some(&2) {
if !matches!(format, [2]) {
bail!("Unknown chunk format");
}
let mut decoder = ZlibDecoder::new(&buf[..]);
let mut decoder = ZlibDecoder::new(buf);
let mut decode_buffer = vec![];
decoder
.read_to_end(&mut decode_buffer)