From b5b6014edf0da61f72840adefe8cadd2aac64479 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Thu, 10 Sep 2020 15:50:35 +0200 Subject: [PATCH] wasm backends: Fix default_output_config behaviour --- src/host/emscripten/mod.rs | 2 +- src/host/webaudio/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/host/emscripten/mod.rs b/src/host/emscripten/mod.rs index dbf5078..07505aa 100644 --- a/src/host/emscripten/mod.rs +++ b/src/host/emscripten/mod.rs @@ -107,7 +107,7 @@ impl Device { configs.sort_by(|a, b| a.cmp_default_heuristics(b)); let config = configs .into_iter() - .next() + .last() .expect(EXPECT) .with_sample_rate(DEFAULT_SAMPLE_RATE); Ok(config) diff --git a/src/host/webaudio/mod.rs b/src/host/webaudio/mod.rs index f58f18c..6db820a 100644 --- a/src/host/webaudio/mod.rs +++ b/src/host/webaudio/mod.rs @@ -125,7 +125,7 @@ impl Device { configs.sort_by(|a, b| a.cmp_default_heuristics(b)); let config = configs .into_iter() - .next() + .last() .expect(EXPECT) .with_sample_rate(DEFAULT_SAMPLE_RATE); Ok(config)