swf: Don't error if both libflate and flate2 features are enabled

Fixes errors I was getting from rust-analyzer checking with all
features enabled.
This commit is contained in:
Mike Welsh 2020-05-12 23:51:53 -07:00
parent b59140ee01
commit deef891c30
2 changed files with 2 additions and 2 deletions

View File

@ -133,7 +133,7 @@ fn make_zlib_reader<'a, R: Read + 'a>(input: R) -> Result<Box<dyn Read + 'a>> {
Ok(Box::new(ZlibDecoder::new(input)))
}
#[cfg(feature = "libflate")]
#[cfg(all(feature = "libflate", not(feature = "flate2")))]
fn make_zlib_reader<'a, R: Read + 'a>(input: R) -> Result<Box<dyn Read + 'a>> {
use libflate::zlib::Decoder;
let decoder = Decoder::new(input)?;

View File

@ -88,7 +88,7 @@ fn write_zlib_swf<W: Write>(mut output: W, swf_body: &[u8]) -> Result<()> {
Ok(())
}
#[cfg(feature = "libflate")]
#[cfg(all(feature = "libflate", not(feature = "flate2")))]
fn write_zlib_swf<W: Write>(mut output: W, swf_body: &[u8]) -> Result<()> {
use libflate::zlib::Encoder;
let mut encoder = Encoder::new(&mut output)?;