chore: Fix a build error
This commit is contained in:
parent
888e5fac16
commit
8e92cc4d81
2 changed files with 4 additions and 4 deletions
|
@ -43,7 +43,7 @@ pub trait LittleEndianWriteExt: Write {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<W: Write> LittleEndianWriteExt for W {}
|
impl<W: Write + ?Sized> LittleEndianWriteExt for W {}
|
||||||
|
|
||||||
/// Helper methods for reading unsigned integers in little-endian form.
|
/// Helper methods for reading unsigned integers in little-endian form.
|
||||||
pub trait LittleEndianReadExt: Read {
|
pub trait LittleEndianReadExt: Read {
|
||||||
|
|
|
@ -21,7 +21,7 @@ use std::default::Default;
|
||||||
use std::fmt::{Debug, Formatter};
|
use std::fmt::{Debug, Formatter};
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use std::io::{BufReader, SeekFrom};
|
use std::io::{BufReader, Cursor, SeekFrom};
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::str::{from_utf8, Utf8Error};
|
use std::str::{from_utf8, Utf8Error};
|
||||||
|
@ -882,9 +882,9 @@ impl<W: Write + Seek> ZipWriter<W> {
|
||||||
};
|
};
|
||||||
if pad_length >= 4 {
|
if pad_length >= 4 {
|
||||||
// Add an extra field to the extra_data, per APPNOTE 4.6.11
|
// Add an extra field to the extra_data, per APPNOTE 4.6.11
|
||||||
let pad_body = vec![0; pad_length - 4];
|
let mut pad_body = vec![0; pad_length - 4];
|
||||||
if pad_body.len() >= 2 {
|
if pad_body.len() >= 2 {
|
||||||
pad_body[0..2].write_u16_le(options.alignment)?;
|
Cursor::new(&mut pad_body).write_u16_le(options.alignment)?;
|
||||||
}
|
}
|
||||||
writer.write_u16_le(0xa11e)?;
|
writer.write_u16_le(0xa11e)?;
|
||||||
writer
|
writer
|
||||||
|
|
Loading…
Add table
Reference in a new issue