mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-16 10:49:55 +00:00
Merge pull request #872 from TaKO8Ki/fix-clippy-warnings
This commit is contained in:
commit
a9580a9f76
3 changed files with 5 additions and 4 deletions
|
@ -22,7 +22,8 @@ pub static RUNTIME: Lazy<Runtime> = Lazy::new(|| {
|
||||||
.unwrap_or_else(|_| num_cpus::get())
|
.unwrap_or_else(|_| num_cpus::get())
|
||||||
.max(1);
|
.max(1);
|
||||||
|
|
||||||
let thread_name = env::var("ASYNC_STD_THREAD_NAME").unwrap_or("async-std/runtime".to_string());
|
let thread_name =
|
||||||
|
env::var("ASYNC_STD_THREAD_NAME").unwrap_or_else(|_| "async-std/runtime".to_string());
|
||||||
|
|
||||||
for _ in 0..thread_count {
|
for _ in 0..thread_count {
|
||||||
thread::Builder::new()
|
thread::Builder::new()
|
||||||
|
|
|
@ -41,9 +41,9 @@ where
|
||||||
let mut this = self.project();
|
let mut this = self.project();
|
||||||
let next = futures_core::ready!(this.stream.as_mut().poll_next(cx));
|
let next = futures_core::ready!(this.stream.as_mut().poll_next(cx));
|
||||||
|
|
||||||
Poll::Ready(next.and_then(|x| {
|
Poll::Ready(next.map(|x| {
|
||||||
(this.f)(&x);
|
(this.f)(&x);
|
||||||
Some(x)
|
x
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl Builder {
|
||||||
#[cfg(not(target_os = "unknown"))]
|
#[cfg(not(target_os = "unknown"))]
|
||||||
once_cell::sync::Lazy::force(&crate::rt::RUNTIME);
|
once_cell::sync::Lazy::force(&crate::rt::RUNTIME);
|
||||||
|
|
||||||
let tag = TaskLocalsWrapper::new(task.clone());
|
let tag = TaskLocalsWrapper::new(task);
|
||||||
|
|
||||||
SupportTaskLocals { tag, future }
|
SupportTaskLocals { tag, future }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue