Skip to content

Commit

Permalink
Update ancient dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tilpner committed Mar 12, 2018
1 parent fc04e3d commit 13eb774
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
6 changes: 3 additions & 3 deletions codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ homepage = "https://github.com/tilpner/includedir"
repository = "https://github.com/tilpner/includedir"

[dependencies]
walkdir = "0.1.5"
phf_codegen = "0.7.16"
flate2 = "0.2.14"
walkdir = "2.1.4"
phf_codegen = "0.7.21"
flate2 = "1.0.1"
5 changes: 2 additions & 3 deletions codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};

use walkdir::WalkDir;

use flate2::FlateWriteExt;
use flate2::write::GzEncoder;

#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum Compression {
Expand Down Expand Up @@ -80,7 +80,6 @@ impl IncludeDir {
c if self.passthrough || c == Compression::Passthrough => {
self.files.insert(as_key(key.borrow()).into_owned(),
(Compression::Passthrough, PathBuf::new()));

}
Compression::None => {
self.files.insert(as_key(key.borrow()).into_owned(),
Expand All @@ -94,7 +93,7 @@ impl IncludeDir {
let out_path = Path::new(&env::var("OUT_DIR").unwrap()).join(&path);
try!(fs::create_dir_all(&out_path.parent().unwrap()));
let out_file = BufWriter::new(try!(File::create(&out_path)));
let mut encoder = out_file.gz_encode(flate2::Compression::Default);
let mut encoder = GzEncoder::new(out_file, flate2::Compression::best());

try!(io::copy(&mut in_file, &mut encoder));

Expand Down
4 changes: 1 addition & 3 deletions example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ include = ["data", "data/*", "data/**"]
publish = false

[dependencies]
phf = "0.7.16"
# includedir = "0.2.0"
phf = "0.7.21"
includedir = { path = "../lib" }

[build-dependencies]
# includedir_codegen = "0.2.0"
includedir_codegen = { path = "../codegen" }
4 changes: 2 additions & 2 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ repository = "https://github.com/tilpner/includedir"
default = ["flate2"]

[dependencies]
phf = "0.7.16"
phf = "0.7.21"

flate2 = { version = "0.2.14", optional = true }
flate2 = { version = "1.0.1", optional = true }
6 changes: 3 additions & 3 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::io::{self, BufReader, Cursor, Error, ErrorKind, Read};
use std::fs::File;

#[cfg(feature = "flate2")]
use flate2::FlateReadExt;
use flate2::bufread::GzDecoder;

pub enum Compression {
None,
Expand Down Expand Up @@ -51,7 +51,7 @@ impl Files {
Compression::None => Ok(Cow::Borrowed(b.1)),
#[cfg(feature = "flate2")]
Compression::Gzip => {
let mut r = try!(Cursor::new(b.1).gz_decode());
let mut r = GzDecoder::new(Cursor::new(b.1));
let mut v = Vec::new();
try!(r.read_to_end(&mut v));
Ok(Cow::Owned(v))
Expand All @@ -77,7 +77,7 @@ impl Files {
match b.0 {
Compression::None => Ok(Box::new(Cursor::new(b.1))),
#[cfg(feature = "flate2")]
Compression::Gzip => Ok(Box::new(try!(Cursor::new(b.1).gz_decode()))),
Compression::Gzip => Ok(Box::new(GzDecoder::new(Cursor::new(b.1)))),
#[cfg(not(feature = "flate2"))]
Compression::Gzip => panic!("Feature 'flate2' not enabled"),
Compression::Passthrough => {
Expand Down

0 comments on commit 13eb774

Please sign in to comment.