Closed cosmicexplorer closed 5 months ago
The cfg-if
crate was made redundant by the cfg! macro, which makes it possible to check configuration flags in a normal if
statement. Even if that weren't the case, it doesn't look to me like this PR adds any readability -- the cfg-if!
is just another pair of curlies to keep track of, and the cfg!
macros remain just as complicated.
This repo is unmaintained. If you'd still like to submit an improvement, do so at https://github.com/zip-rs/zip2.
cfg-if
crate makes it easier to read conditional compilation logic.docs.rs
builds to show whether some value is only available with a given feature enabled (see e.g. rust-random/rand#986).RUSTDOCFLAGS='--cfg docsrs' cargo doc
(try opening e.g.CompressionMethod
to see how this shows which enum cases are supported by which features).This is not a breaking change, as
cfg-if
should generate the same code as before.