mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-22 07:06:41 +11:00
try_recv to remove unwrap
This commit is contained in:
parent
afddd77ce8
commit
45f8a52eb5
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
&config.into(),
|
||||
move |data: &mut [f32], _| {
|
||||
for val in data.iter_mut() {
|
||||
*val = rx.recv().unwrap();
|
||||
*val = rx.try_recv().unwrap_or(0.0);
|
||||
}
|
||||
},
|
||||
|err| eprintln!("Error on audio stream {err}"),
|
||||
|
|
Loading…
Add table
Reference in a new issue