Remove Unneeded Imports (#552)
This commit is contained in:
parent
b450b67812
commit
b4bdbfc9f3
@ -2,10 +2,7 @@
|
||||
//!
|
||||
//! cargo run --features="event-stream" --example event-stream-async-std
|
||||
|
||||
use std::{
|
||||
io::{stdout, Write},
|
||||
time::Duration,
|
||||
};
|
||||
use std::{io::stdout, time::Duration};
|
||||
|
||||
use futures::{future::FutureExt, select, StreamExt};
|
||||
use futures_timer::Delay;
|
||||
|
@ -2,10 +2,7 @@
|
||||
//!
|
||||
//! cargo run --features="event-stream" --example event-stream-tokio
|
||||
|
||||
use std::{
|
||||
io::{stdout, Write},
|
||||
time::Duration,
|
||||
};
|
||||
use std::{io::stdout, time::Duration};
|
||||
|
||||
use futures::{future::FutureExt, select, StreamExt};
|
||||
use futures_timer::Delay;
|
||||
|
@ -113,7 +113,9 @@ impl Stream for EventStream {
|
||||
Ok(false) => {
|
||||
if !self
|
||||
.stream_wake_task_executed
|
||||
.compare_and_swap(false, true, Ordering::SeqCst)
|
||||
.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst)
|
||||
// https://github.com/rust-lang/rust/issues/80486#issuecomment-752244166
|
||||
.unwrap_or_else(|x| x)
|
||||
{
|
||||
let stream_waker = cx.waker().clone();
|
||||
let stream_wake_task_executed = self.stream_wake_task_executed.clone();
|
||||
|
@ -27,12 +27,13 @@ impl Waker {
|
||||
.lock()
|
||||
.unwrap()
|
||||
.wake()
|
||||
.map_err(|e| ErrorKind::IoError(e))
|
||||
.map_err(ErrorKind::IoError)
|
||||
}
|
||||
|
||||
/// Resets the state so the same waker can be reused.
|
||||
///
|
||||
/// This function is not impl
|
||||
#[allow(dead_code, clippy::clippy::unnecessary_wraps)]
|
||||
pub(crate) fn reset(&self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user