Fix the "Stream::new' method

This commit is contained in:
Viktor Lazarev 2019-08-29 08:31:18 +02:00 committed by mitchmindtree
parent e7f708701c
commit a412b00336
1 changed files with 2 additions and 2 deletions

View File

@ -87,14 +87,14 @@ pub (crate) struct StreamInner {
}
impl Stream {
fn new<D, E>(stream_inner: Arc<StreamInner>, mut data_callback: D, mut error_callback: E) -> Stream
pub (crate) fn new<D, E>(stream_inner: Arc<StreamInner>, mut data_callback: D, mut error_callback: E) -> Stream
where D: FnMut(StreamData) + Send + 'static, E: FnMut(StreamError) + Send + 'static {
let pending_scheduled_event =
unsafe { synchapi::CreateEventA(ptr::null_mut(), 0, 0, ptr::null()) };
let (tx, rx) = channel();
let run_context = RunContext {
stream: Arc::new(stream_inner),
stream: stream_inner,
handles: vec![pending_scheduled_event],
commands: rx,
};