refactor: Remove unnecessary #[cfg] attributes
This commit is contained in:
parent
23068ad7c2
commit
819f86537c
2 changed files with 20 additions and 43 deletions
|
@ -12,13 +12,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
#[cfg(feature = "_deflate-any")]
|
||||
{
|
||||
let filename = &*args[1];
|
||||
doit(filename)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "_deflate-any")]
|
||||
fn doit(filename: &str) -> zip::result::ZipResult<()> {
|
||||
use std::io::Write;
|
||||
|
||||
use zip::write::SimpleFileOptions;
|
||||
|
@ -39,5 +32,6 @@ fn doit(filename: &str) -> zip::result::ZipResult<()> {
|
|||
bytes_written += content.len() as u64;
|
||||
}
|
||||
zip.finish()?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -35,23 +35,6 @@ fn main() {
|
|||
std::process::exit(real_main());
|
||||
}
|
||||
|
||||
const METHOD_STORED: Option<zip::CompressionMethod> = Some(zip::CompressionMethod::Stored);
|
||||
|
||||
#[cfg(feature = "_deflate-any")]
|
||||
const METHOD_DEFLATED: Option<zip::CompressionMethod> = Some(zip::CompressionMethod::Deflated);
|
||||
#[cfg(not(feature = "_deflate-any"))]
|
||||
const METHOD_DEFLATED: Option<zip::CompressionMethod> = None;
|
||||
|
||||
#[cfg(feature = "bzip2")]
|
||||
const METHOD_BZIP2: Option<zip::CompressionMethod> = Some(zip::CompressionMethod::Bzip2);
|
||||
#[cfg(not(feature = "bzip2"))]
|
||||
const METHOD_BZIP2: Option<zip::CompressionMethod> = None;
|
||||
|
||||
#[cfg(feature = "zstd")]
|
||||
const METHOD_ZSTD: Option<zip::CompressionMethod> = Some(zip::CompressionMethod::Zstd);
|
||||
#[cfg(not(feature = "zstd"))]
|
||||
const METHOD_ZSTD: Option<zip::CompressionMethod> = None;
|
||||
|
||||
fn real_main() -> i32 {
|
||||
let args = Args::parse();
|
||||
let src_dir = &args.source;
|
||||
|
|
Loading…
Add table
Reference in a new issue