chore: Fix errors by moving use
statements inside the cfg-guarded function that uses them
This commit is contained in:
parent
5a3126894c
commit
63793a32ff
1 changed files with 4 additions and 3 deletions
|
@ -1,8 +1,5 @@
|
||||||
//! Write a huge file with lots of zeros, that should compress perfectly.
|
//! Write a huge file with lots of zeros, that should compress perfectly.
|
||||||
|
|
||||||
use std::io::Write;
|
|
||||||
|
|
||||||
use zip::write::SimpleFileOptions;
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
if !cfg!(feature = "_deflate-any") {
|
if !cfg!(feature = "_deflate-any") {
|
||||||
return Err("Please enable one of the deflate features".into());
|
return Err("Please enable one of the deflate features".into());
|
||||||
|
@ -22,6 +19,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
||||||
#[cfg(feature = "_deflate-any")]
|
#[cfg(feature = "_deflate-any")]
|
||||||
fn doit(filename: &str) -> zip::result::ZipResult<()> {
|
fn doit(filename: &str) -> zip::result::ZipResult<()> {
|
||||||
|
use std::io::Write;
|
||||||
|
|
||||||
|
use zip::write::SimpleFileOptions;
|
||||||
|
|
||||||
let file = std::fs::File::create(filename)?;
|
let file = std::fs::File::create(filename)?;
|
||||||
let mut zip = zip::ZipWriter::new(file);
|
let mut zip = zip::ZipWriter::new(file);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue