Use Rust 1.60 feature syntax
This commit is contained in:
parent
f70fe61e05
commit
f6e3614fe9
2 changed files with 8 additions and 6 deletions
10
Cargo.toml
10
Cargo.toml
|
|
@ -83,11 +83,13 @@ clap_mangen = "0.2.20"
|
||||||
rustc_version = "0.4.0"
|
rustc_version = "0.4.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
binary = ["clap", "glob", "env_logger"]
|
binary = ["dep:clap", "dep:glob", "dep:env_logger"]
|
||||||
default = ["binary", "filetime", "parallel", "zopfli"]
|
default = ["binary", "parallel", "zopfli", "filetime"]
|
||||||
parallel = ["rayon", "indexmap/rayon", "crossbeam-channel"]
|
parallel = ["dep:rayon", "indexmap/rayon", "dep:crossbeam-channel"]
|
||||||
freestanding = ["libdeflater/freestanding"]
|
freestanding = ["libdeflater/freestanding"]
|
||||||
sanity-checks = ["image"]
|
sanity-checks = ["dep:image"]
|
||||||
|
zopfli = ["dep:zopfli"]
|
||||||
|
filetime = ["dep:filetime"]
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "oxipng"
|
name = "oxipng"
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ fn verbose_mode() {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature = "rayon")]
|
#[cfg(feature = "parallel")]
|
||||||
rayon::ThreadPoolBuilder::new()
|
rayon::ThreadPoolBuilder::new()
|
||||||
.start_handler(move |_| thread_init())
|
.start_handler(move |_| thread_init())
|
||||||
.num_threads(rayon::current_num_threads() + 1)
|
.num_threads(rayon::current_num_threads() + 1)
|
||||||
|
|
@ -173,7 +173,7 @@ fn verbose_mode() {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.install(move || rayon::spawn(thread_exec));
|
.install(move || rayon::spawn(thread_exec));
|
||||||
|
|
||||||
#[cfg(not(feature = "rayon"))]
|
#[cfg(not(feature = "parallel"))]
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
thread_init();
|
thread_init();
|
||||||
thread_exec();
|
thread_exec();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue