@@ -111,23 +111,28 @@ impl ExtraFieldMagic {
111111///
112112/// let big_len: usize = (zip::ZIP64_BYTES_THR as usize) + 1;
113113/// let big_buf = vec![0u8; big_len];
114+ /// {
114115/// zip.start_file("zero.dat", options)?;
115116/// // This is too big!
116117/// let res = zip.write_all(&big_buf[..]).err().unwrap();
117118/// assert_eq!(res.kind(), io::ErrorKind::Other);
118119/// let description = format!("{}", &res);
119120/// assert_eq!(description, "Large file option has not been set");
121+ /// }
122+ /// {
120123/// // Attempting to write anything further to the same zip will still succeed, but the previous
121124/// // failing entry has been removed.
122125/// zip.start_file("one.dat", options)?;
123126/// let zip = zip.finish_into_readable()?;
124127/// let names: Vec<_> = zip.file_names().collect();
125128/// assert_eq!(&names, &["one.dat"]);
129+ /// }
126130///
127131/// // Create a new zip output.
128132/// let mut zip = ZipWriter::new(Cursor::new(Vec::new()));
129133/// // This time, create a zip64 record for the file.
130- /// let options = options.large_file(true);
134+ /// let options = SimpleFileOptions::default()
135+ /// .compression_method(zip::CompressionMethod::Stored).large_file(true);
131136/// zip.start_file("zero.dat", options)?;
132137/// // This succeeds because we specified that it could be a large file.
133138/// assert!(zip.write_all(&big_buf[..]).is_ok());
0 commit comments