Skip to content

Commit

Permalink
Fix build with --no-default-features (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
tirr-c authored Aug 16, 2024
1 parent c4a0ade commit 72bbd77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions crates/jxl-oxide-cli/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,13 @@ pub fn handle_decode(args: DecodeArgs) -> Result<()> {
}

fn run_once(image: &mut JxlImage) -> Result<(Vec<Render>, Duration)> {
let pool = image.pool();

let mut keyframes = Vec::new();
#[allow(unused_mut)]
let mut rendered = false;

let decode_start = std::time::Instant::now();
#[cfg(feature = "rayon")]
if let Some(rayon_pool) = &pool.as_rayon_pool() {
if let Some(rayon_pool) = image.pool().as_rayon_pool() {
keyframes = rayon_pool
.install(|| {
use rayon::prelude::*;
Expand Down
3 changes: 3 additions & 0 deletions crates/jxl-oxide/benches/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ fn decode(c: &mut Criterion) {
let mut bench_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
bench_path.push("tests/decode/benchmark-data");

#[cfg(feature = "rayon")]
let pool = JxlThreadPool::rayon(None);
#[cfg(not(feature = "rayon"))]
let pool = JxlThreadPool::none();

bench_one(c, &bench_path, "lumine-paimon.d0-e7", &pool);
bench_one(c, &bench_path, "minecraft.d0-e6", &pool);
Expand Down

0 comments on commit 72bbd77

Please sign in to comment.