changeset 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 8a3b8e2ffa24
children dbe2ddca4a8b
files formats/src/bin/dump_dat.rs formats/src/th06/pbg3.rs
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/formats/src/bin/dump_dat.rs
+++ b/formats/src/bin/dump_dat.rs
@@ -24,7 +24,7 @@ fn main() -> io::Result<()> {
     for filename in list {
         let data = pbg3.get_file(&filename, true)?;
         let mut output = File::create(output_filename.join(filename))?;
-        output.write(&data)?;
+        output.write_all(&data)?;
     }
 
     Ok(())
--- 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!"));
         }