Skip to content

Commit

Permalink
Use Rust 1.60 feature syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski authored and andrews05 committed Jul 10, 2024
1 parent f70fe61 commit f6e3614
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ clap_mangen = "0.2.20"
rustc_version = "0.4.0"

[features]
binary = ["clap", "glob", "env_logger"]
default = ["binary", "filetime", "parallel", "zopfli"]
parallel = ["rayon", "indexmap/rayon", "crossbeam-channel"]
binary = ["dep:clap", "dep:glob", "dep:env_logger"]
default = ["binary", "parallel", "zopfli", "filetime"]
parallel = ["dep:rayon", "indexmap/rayon", "dep:crossbeam-channel"]
freestanding = ["libdeflater/freestanding"]
sanity-checks = ["image"]
sanity-checks = ["dep:image"]
zopfli = ["dep:zopfli"]
filetime = ["dep:filetime"]

[lib]
name = "oxipng"
Expand Down
4 changes: 2 additions & 2 deletions tests/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ fn verbose_mode() {
);
};

#[cfg(feature = "rayon")]
#[cfg(feature = "parallel")]
rayon::ThreadPoolBuilder::new()
.start_handler(move |_| thread_init())
.num_threads(rayon::current_num_threads() + 1)
.build()
.unwrap()
.install(move || rayon::spawn(thread_exec));

#[cfg(not(feature = "rayon"))]
#[cfg(not(feature = "parallel"))]
std::thread::spawn(move || {
thread_init();
thread_exec();
Expand Down

0 comments on commit f6e3614

Please sign in to comment.