From 493424e93d27f95117fc59208e48887cf3ba9f10 Mon Sep 17 00:00:00 2001 From: Sam Rijs Date: Tue, 6 Nov 2018 23:14:09 +1100 Subject: [PATCH] Use BufReader in file_info example --- examples/file_info.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/file_info.rs b/examples/file_info.rs index f9186251..63f7d87e 100644 --- a/examples/file_info.rs +++ b/examples/file_info.rs @@ -1,6 +1,7 @@ extern crate zip; use std::fs; +use std::io::BufReader; fn main() { std::process::exit(real_main()); @@ -14,8 +15,9 @@ fn real_main() -> i32 { } let fname = std::path::Path::new(&*args[1]); let file = fs::File::open(&fname).unwrap(); + let reader = BufReader::new(file); - let mut archive = zip::ZipArchive::new(file).unwrap(); + let mut archive = zip::ZipArchive::new(reader).unwrap(); for i in 0..archive.len() { let file = archive.by_index(i).unwrap();