From 84fd3a9120c657df80eb0ebd1cb721ed171f74a6 Mon Sep 17 00:00:00 2001 From: atomkern Date: Sat, 20 Sep 2025 19:37:47 +0200 Subject: [PATCH] fix(audio): replace unstable '_' array length with BUFFER_SIZE for stable Rust On stable Rust, using \`_\` to infer array lengths in type position is not stabilized (E0658). This change replaces the inferred lengths with explicit BUFFER_SIZE in audio.rs, matching the const generic used by the buffer processing. No functional changes; fixes build on stable. Refs: rust-lang/rust#85077. --- crates/audio/src/audio.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/audio/src/audio.rs b/crates/audio/src/audio.rs index f60ddb87b9615d..ba79d0b25ccb54 100644 --- a/crates/audio/src/audio.rs +++ b/crates/audio/src/audio.rs @@ -128,7 +128,7 @@ impl Audio { target_os = "freebsd" )))] let source = source.inspect_buffer::(move |buffer| { - let mut buf: [i16; _] = buffer.map(|s| s.to_sample()); + let mut buf: [i16; BUFFER_SIZE] = buffer.map(|s| s.to_sample()); echo_canceller .lock() .process_reverse_stream( @@ -169,7 +169,7 @@ impl Audio { let (replay, stream) = UniformSourceIterator::new(stream, CHANNEL_COUNT, SAMPLE_RATE) .limit(LimitSettings::live_performance()) .process_buffer::(move |buffer| { - let mut int_buffer: [i16; _] = buffer.map(|s| s.to_sample()); + let mut int_buffer: [i16; BUFFER_SIZE] = buffer.map(|s| s.to_sample()); if voip_parts .echo_canceller .lock()