Use Rust 1.60 feature syntax

This commit is contained in:
Kornel 2024-07-09 14:24:21 +01:00 committed by andrews05
parent f70fe61e05
commit f6e3614fe9
2 changed files with 8 additions and 6 deletions

View file

@ -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"

View file

@ -165,7 +165,7 @@ fn verbose_mode() {
);
};
#[cfg(feature = "rayon")]
#[cfg(feature = "parallel")]
rayon::ThreadPoolBuilder::new()
.start_handler(move |_| thread_init())
.num_threads(rayon::current_num_threads() + 1)
@ -173,7 +173,7 @@ fn verbose_mode() {
.unwrap()
.install(move || rayon::spawn(thread_exec));
#[cfg(not(feature = "rayon"))]
#[cfg(not(feature = "parallel"))]
std::thread::spawn(move || {
thread_init();
thread_exec();