From 855d57610c09914e79fc45f8529dc7e6adfba44b Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Thu, 2 May 2024 13:35:08 -0700 Subject: [PATCH] style: Fix unused warnings by making the entire file cfg-dependent --- examples/write-large-file.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/write-large-file.rs b/examples/write-large-file.rs index f7ae183e..8e6b594e 100644 --- a/examples/write-large-file.rs +++ b/examples/write-large-file.rs @@ -1,9 +1,9 @@ +#![cfg(feature = "_deflate-any")] //! Write a huge file with lots of zeros, that should compress perfectly. use std::io::Write; use zip::write::SimpleFileOptions; -#[cfg(feature = "_deflate-any")] fn main() -> Result<(), Box> { let args: Vec<_> = std::env::args().collect(); if args.len() < 2 { @@ -15,7 +15,6 @@ fn main() -> Result<(), Box> { Ok(()) } -#[cfg(feature = "_deflate-any")] fn doit(filename: &str) -> zip::result::ZipResult<()> { let file = std::fs::File::create(filename)?; let mut zip = zip::ZipWriter::new(file);