io: remove a few unnecessary [..] for Vec -> slice deref

This commit is contained in:
Matthias Schiffer 2023-01-28 00:58:47 +01:00
parent 3cdafa7be9
commit da8ac506d9
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
2 changed files with 3 additions and 3 deletions

View file

@ -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>

View file

@ -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;
} }