From c97d6ed76035245dfed1592b3ecf3ebef2ce76b4 Mon Sep 17 00:00:00 2001 From: Mathijs van de Nes Date: Wed, 2 Sep 2015 11:52:30 +0200 Subject: [PATCH] Use read_exact from ReadPodExt explicitly The newely added read_exact from std::..::Read has an incompatible signature and is not yet stabilized. This ensures that the crate will work on stable and nightly. --- src/read.rs | 6 +++--- src/spec.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/read.rs b/src/read.rs index 54a28b06..0bd88e43 100644 --- a/src/read.rs +++ b/src/read.rs @@ -195,9 +195,9 @@ fn central_header_to_zip_file(reader: &mut R) -> ZipResult()); try!(reader.read_u32::()); let offset = try!(reader.read_u32::()) as u64; - let file_name_raw = try!(reader.read_exact(file_name_length)); - let extra_field = try!(reader.read_exact(extra_field_length)); - let file_comment_raw = try!(reader.read_exact(file_comment_length)); + let file_name_raw = try!(ReadPodExt::read_exact(reader, file_name_length)); + let extra_field = try!(ReadPodExt::read_exact(reader, extra_field_length)); + let file_comment_raw = try!(ReadPodExt::read_exact(reader, file_comment_length)); let file_name = match is_utf8 { diff --git a/src/spec.rs b/src/spec.rs index 1d21acbc..bce23f88 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -34,7 +34,7 @@ impl CentralDirectoryEnd let central_directory_size = try!(reader.read_u32::()); let central_directory_offset = try!(reader.read_u32::()); let zip_file_comment_length = try!(reader.read_u16::()) as usize; - let zip_file_comment = try!(reader.read_exact(zip_file_comment_length)); + let zip_file_comment = try!(ReadPodExt::read_exact(reader, zip_file_comment_length)); Ok(CentralDirectoryEnd {