Use the correct start index for iteration
This commit is contained in:
parent
86ec190ba6
commit
522039a70d
2 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ fn main()
|
|||
|
||||
let mut archive = zip::ZipArchive::new(file).unwrap();
|
||||
|
||||
for i in 1..archive.len()
|
||||
for i in 0..archive.len()
|
||||
{
|
||||
let mut file = archive.by_index(i).unwrap();
|
||||
let outpath = sanitize_filename(file.name());
|
||||
|
|
|
@ -29,7 +29,7 @@ use types::ZipFileData;
|
|||
///
|
||||
/// let mut zip = try!(zip::ZipArchive::new(reader));
|
||||
///
|
||||
/// for i in 1..zip.len()
|
||||
/// for i in 0..zip.len()
|
||||
/// {
|
||||
/// let mut file = zip.by_index(i).unwrap();
|
||||
/// println!("Filename: {}", file.name());
|
||||
|
@ -96,7 +96,7 @@ impl<R: Read+io::Seek> ZipArchive<R>
|
|||
/// fn iter() {
|
||||
/// let mut zip = zip::ZipArchive::new(std::io::Cursor::new(vec![])).unwrap();
|
||||
///
|
||||
/// for i in 1..zip.len() {
|
||||
/// for i in 0..zip.len() {
|
||||
/// let mut file = zip.by_index(i).unwrap();
|
||||
/// // Do something with file i
|
||||
/// }
|
||||
|
|
Loading…
Add table
Reference in a new issue