diff --git a/src/spec.rs b/src/spec.rs index dd3b812f..2de74f77 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -83,7 +83,7 @@ impl CentralDirectoryEnd try!(writer.write_u32::(self.central_directory_size)); try!(writer.write_u32::(self.central_directory_offset)); try!(writer.write_u16::(self.zip_file_comment.len() as u16)); - try!(writer.write_all(self.zip_file_comment.as_slice())); + try!(writer.write_all(&self.zip_file_comment)); Ok(()) } } diff --git a/src/write.rs b/src/write.rs index 906f909d..e381aa78 100644 --- a/src/write.rs +++ b/src/write.rs @@ -299,7 +299,7 @@ fn write_local_file_header(writer: &mut T, file: &ZipFileData) -> ZipR let extra_field = try!(build_extra_field(file)); try!(writer.write_u16::(extra_field.len() as u16)); try!(writer.write_all(file.file_name.as_bytes())); - try!(writer.write_all(extra_field.as_slice())); + try!(writer.write_all(&extra_field)); Ok(()) } @@ -336,7 +336,7 @@ fn write_central_directory_header(writer: &mut T, file: &ZipFileData) try!(writer.write_u32::(0)); try!(writer.write_u32::(file.header_start as u32)); try!(writer.write_all(file.file_name.as_bytes())); - try!(writer.write_all(extra_field.as_slice())); + try!(writer.write_all(&extra_field)); Ok(()) }