Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cubeb-api/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ use std::slice::{from_raw_parts, from_raw_parts_mut};
use std::{ops, panic, ptr};
use {ContextRef, DeviceId, Error, Result, State, StreamParamsRef};

pub type DataCallback<F> = dyn FnMut(&[F], &mut [F]) -> isize + Send + Sync + 'static;
pub type StateCallback = dyn FnMut(State) + Send + Sync + 'static;
pub type DeviceChangedCallback = dyn FnMut() + Send + Sync + 'static;
pub type DataCallback<F> = dyn FnMut(&[F], &mut [F]) -> isize + Send + 'static;
pub type StateCallback = dyn FnMut(State) + Send + 'static;
pub type DeviceChangedCallback = dyn FnMut() + Send + 'static;

pub struct StreamCallbacks<F> {
pub(crate) data: Box<DataCallback<F>>,
Expand Down Expand Up @@ -119,14 +119,14 @@ impl<'a, F> StreamBuilder<'a, F> {

pub fn data_callback<D>(&mut self, cb: D) -> &mut Self
where
D: FnMut(&[F], &mut [F]) -> isize + Send + Sync + 'static,
D: FnMut(&[F], &mut [F]) -> isize + Send + 'static,
{
self.data_cb = Some(Box::new(cb) as Box<DataCallback<F>>);
self
}
pub fn state_callback<S>(&mut self, cb: S) -> &mut Self
where
S: FnMut(State) + Send + Sync + 'static,
S: FnMut(State) + Send + 'static,
{
self.state_cb = Some(Box::new(cb) as Box<StateCallback>);
self
Expand Down Expand Up @@ -164,7 +164,7 @@ impl<'a, F> StreamBuilder<'a, F> {

pub fn device_changed_cb<CB>(&mut self, cb: CB) -> &mut Self
where
CB: FnMut() + Send + Sync + 'static,
CB: FnMut() + Send + 'static,
{
self.device_changed_cb = Some(Box::new(cb) as Box<DeviceChangedCallback>);
self
Expand Down
1 change: 1 addition & 0 deletions cubeb-backend/tests/test_capi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use std::ptr;
pub const OPS: Ops = capi_new!(TestContext, TestStream);

struct TestContext {
#[allow(dead_code)]
pub ops: *const Ops,
}

Expand Down