Skip to content

Commit

Permalink
swf: Remove 'libflate' feature
Browse files Browse the repository at this point in the history
The 'flate2' crate already supports both C and pure Rust
backends, so we don't gain anything by supporting libflate
  • Loading branch information
Aaron1011 authored and torokati44 committed Jul 12, 2024
1 parent ea0bbce commit c852990
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 77 deletions.
52 changes: 0 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ Ruffle depends on third-party libraries with compatible licenses.
| [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2010 The Rust Project Developers |
| [lazycell](https://github.com/indiv0/lazycell) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) Alex Crichton <[email protected]>, Nikita Pekin <[email protected]> |
| [libc](https://github.com/rust-lang/libc) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014-2020 The Rust Project Developers |
| [libflate](https://github.com/sile/libflate) | [MIT](#MIT) | Copyright (c) 2016 Takeru Ohta <[email protected]> |
| [libflate_lz77](https://github.com/sile/libflate) | [MIT](#MIT) | Copyright (c) 2016 Takeru Ohta <[email protected]> |
| [libloading](https://github.com/nagisa/rust_libloading/) | [ISC](#ISC) | Copyright © 2015, Simonas Kazlauskas |
| [libnghttp2-sys](https://github.com/alexcrichton/nghttp2-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton |
| [libz-sys](https://github.com/rust-lang/libz-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton Copyright (c) 2020 Josh Triplett |
Expand Down
1 change: 0 additions & 1 deletion swf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ byteorder = "1.5"
encoding_rs = "0.8.34"
num-derive = { workspace = true }
num-traits = { workspace = true }
libflate = {version = "2.1", optional = true}
log = { workspace = true }
flate2 = { workspace = true, optional = true}
lzma-rs = {version = "0.3.0", optional = true }
Expand Down
2 changes: 0 additions & 2 deletions swf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#[cfg(feature = "flate2")]
extern crate flate2;
#[cfg(feature = "libflate")]
extern crate libflate;
#[macro_use]
extern crate num_derive;
extern crate num_traits;
Expand Down
9 changes: 1 addition & 8 deletions swf/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,7 @@ fn make_zlib_reader<'a, R: Read + 'a>(input: R) -> Result<Box<dyn Read + 'a>> {
Ok(Box::new(ZlibDecoder::new(input)))
}

#[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)?;
Ok(Box::new(decoder))
}

#[cfg(not(any(feature = "flate2", feature = "libflate")))]
#[cfg(not(feature = "flate2"))]
fn make_zlib_reader<'a, R: Read + 'a>(_input: R) -> Result<Box<dyn Read + 'a>> {
Err(Error::unsupported(
"Support for Zlib compressed SWFs is not enabled.",
Expand Down
11 changes: 1 addition & 10 deletions swf/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,7 @@ fn write_zlib_swf<W: Write>(mut output: W, swf_body: &[u8]) -> Result<()> {
Ok(())
}

#[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)?;
encoder.write_all(&swf_body)?;
encoder.finish().into_result()?;
Ok(())
}

#[cfg(not(any(feature = "flate2", feature = "libflate")))]
#[cfg(not(feature = "flate2"))]
fn write_zlib_swf<W: Write>(_output: W, _swf_body: &[u8]) -> Result<()> {
Err(Error::unsupported(
"Support for Zlib compressed SWFs is not enabled.",
Expand Down
2 changes: 0 additions & 2 deletions web/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ Ruffle depends on third-party libraries with compatible licenses.
| [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2010 The Rust Project Developers |
| [lazycell](https://github.com/indiv0/lazycell) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) Alex Crichton <[email protected]>, Nikita Pekin <[email protected]> |
| [libc](https://github.com/rust-lang/libc) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014-2020 The Rust Project Developers |
| [libflate](https://github.com/sile/libflate) | [MIT](#MIT) | Copyright (c) 2016 Takeru Ohta <[email protected]> |
| [libflate_lz77](https://github.com/sile/libflate) | [MIT](#MIT) | Copyright (c) 2016 Takeru Ohta <[email protected]> |
| [libloading](https://github.com/nagisa/rust_libloading/) | [ISC](#ISC) | Copyright © 2015, Simonas Kazlauskas |
| [libnghttp2-sys](https://github.com/alexcrichton/nghttp2-rs) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton |
| [libz-sys](https://github.com/rust-lang/libz-sys) | [Apache-2.0](#Apache-20)/[MIT](#MIT) | Copyright (c) 2014 Alex Crichton Copyright (c) 2020 Josh Triplett |
Expand Down

0 comments on commit c852990

Please sign in to comment.