mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-05 17:44:52 +01:00
io: remove a few unnecessary [..] for Vec -> slice deref
This commit is contained in:
parent
3cdafa7be9
commit
da8ac506d9
2 changed files with 3 additions and 3 deletions
|
@ -15,7 +15,7 @@ where
|
||||||
.read_to_end(&mut buf)
|
.read_to_end(&mut buf)
|
||||||
.context("Failed to read file")?;
|
.context("Failed to read file")?;
|
||||||
|
|
||||||
fastnbt::from_bytes(&buf[..]).context("Failed to decode NBT data")
|
fastnbt::from_bytes(&buf).context("Failed to decode NBT data")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_file<P, T>(path: P) -> Result<T>
|
pub fn from_file<P, T>(path: P) -> Result<T>
|
||||||
|
|
|
@ -104,10 +104,10 @@ impl<R: Read + Seek> Region<R> {
|
||||||
|
|
||||||
let mut buffer = vec![0; (len as usize) * BLOCKSIZE];
|
let mut buffer = vec![0; (len as usize) * BLOCKSIZE];
|
||||||
reader
|
reader
|
||||||
.read_exact(&mut buffer[..])
|
.read_exact(&mut buffer)
|
||||||
.context("Failed to read chunk data")?;
|
.context("Failed to read chunk data")?;
|
||||||
|
|
||||||
f(coords, decode_chunk(&buffer[..])?);
|
f(coords, decode_chunk(&buffer)?);
|
||||||
|
|
||||||
index += len as u32;
|
index += len as u32;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue