Skip to content

Commit 504197a

Browse files
committed
Ignore clippy warning of Arc for non-Send type, add as TODO
#357
1 parent 696a521 commit 504197a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/io/cpal.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ use crate::{AtomicF64, MAX_CHANNELS};
2020

2121
use crossbeam_channel::Receiver;
2222

23+
// I doubt this construct is entirely safe. Stream is not Send/Sync (probably for a good reason) so
24+
// it should be managed from a single thread instead.
25+
// <https://github.com/orottier/web-audio-api-rs/issues/357>
2326
mod private {
2427
use super::*;
2528

@@ -28,6 +31,7 @@ mod private {
2831

2932
impl ThreadSafeClosableStream {
3033
pub fn new(stream: Stream) -> Self {
34+
#[allow(clippy::arc_with_non_send_sync)]
3135
Self(Arc::new(Mutex::new(Some(stream))))
3236
}
3337

src/io/cubeb.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ impl<F> CubebStream for Stream<F> {
3434
}
3535
}
3636

37+
// I doubt this construct is entirely safe. Stream is not Send/Sync (probably for a good reason) so
38+
// it should be managed from a single thread instead.
39+
// <https://github.com/orottier/web-audio-api-rs/issues/357>
3740
mod private {
3841
use super::*;
3942
use std::sync::Mutex;
@@ -44,6 +47,7 @@ mod private {
4447
impl ThreadSafeClosableStream {
4548
pub fn new<F: 'static>(stream: Stream<F>) -> Self {
4649
let boxed_stream = BoxedStream(Box::new(stream));
50+
#[allow(clippy::arc_with_non_send_sync)]
4751
Self(Arc::new(Mutex::new(Some(boxed_stream))))
4852
}
4953

0 commit comments

Comments
 (0)