diff formats/src/th06/pbg3.rs @ 767:ccb04468c5fa

formats: Use Read::read_exact() and Write::write_all() Thanks clippy!
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 30 Aug 2022 17:07:21 +0200
parents f506ad5c9b17
children cae5f15ca5ed
line wrap: on
line diff
--- a/formats/src/th06/pbg3.rs
+++ b/formats/src/th06/pbg3.rs
@@ -100,7 +100,7 @@ impl<R: io::Read + io::Seek> PBG3<R> {
     /// Open a PBG3 archive.
     pub fn from_file(mut file: R) -> io::Result<PBG3<R>> {
         let mut magic = [0; 4];
-        file.read(&mut magic)?;
+        file.read_exact(&mut magic)?;
         if &magic != b"PBG3" {
             return Err(io::Error::new(io::ErrorKind::Other, "Wrong magic!"));
         }