mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-04 21:37:58 +03:00
more fixes
This commit is contained in:
parent
706511c15c
commit
cb9a449ceb
6 changed files with 17 additions and 12 deletions
|
@ -1,4 +1,5 @@
|
|||
//! Framed transport dispatcher
|
||||
#![allow(clippy::let_underscore_future)]
|
||||
use std::{cell::Cell, future, pin::Pin, rc::Rc, task::Context, task::Poll};
|
||||
|
||||
use ntex_bytes::Pool;
|
||||
|
@ -341,7 +342,7 @@ where
|
|||
// call service
|
||||
let shared = slf.shared.clone();
|
||||
shared.inflight.set(shared.inflight.get() + 1);
|
||||
spawn(async move {
|
||||
let _ = spawn(async move {
|
||||
let result = shared.service.call(item).await;
|
||||
shared.handle_result(result, &shared.io);
|
||||
});
|
||||
|
@ -365,7 +366,7 @@ where
|
|||
// call service
|
||||
let shared = slf.shared.clone();
|
||||
shared.inflight.set(shared.inflight.get() + 1);
|
||||
spawn(async move {
|
||||
let _ = spawn(async move {
|
||||
let result = shared.service.call(item).await;
|
||||
shared.handle_result(result, &shared.io);
|
||||
});
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
//! utilities and helpers for testing
|
||||
#![allow(clippy::let_underscore_future)]
|
||||
use std::future::{poll_fn, Future};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::task::{ready, Context, Poll, Waker};
|
||||
|
@ -355,11 +356,11 @@ impl IoStream for IoTest {
|
|||
fn start(self, read: ReadContext, write: WriteContext) -> Option<Box<dyn Handle>> {
|
||||
let io = Rc::new(self);
|
||||
|
||||
ntex_util::spawn(ReadTask {
|
||||
let _ = ntex_util::spawn(ReadTask {
|
||||
io: io.clone(),
|
||||
state: read,
|
||||
});
|
||||
ntex_util::spawn(WriteTask {
|
||||
let _ = ntex_util::spawn(WriteTask {
|
||||
io: io.clone(),
|
||||
state: write,
|
||||
st: IoWriteState::Processing(None),
|
||||
|
|
|
@ -127,7 +127,8 @@ pub(crate) fn register(timeout: Seconds, io: &IoRef) -> TimerHandle {
|
|||
if !timer.running.get() {
|
||||
timer.running.set(true);
|
||||
|
||||
spawn(async move {
|
||||
#[allow(clippy::let_underscore_future)]
|
||||
let _ = spawn(async move {
|
||||
let guard = TimerGuard;
|
||||
loop {
|
||||
sleep(SEC).await;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::let_underscore_future)]
|
||||
use std::any::{Any, TypeId};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::task::{Context, Poll};
|
||||
|
@ -103,7 +104,7 @@ impl Arbiter {
|
|||
|
||||
crate::block_on(async move {
|
||||
// start arbiter controller
|
||||
crate::spawn(ArbiterController {
|
||||
let _ = crate::spawn(ArbiterController {
|
||||
stop: Some(stop),
|
||||
rx: Box::pin(arb_rx),
|
||||
});
|
||||
|
@ -268,7 +269,7 @@ impl Future for ArbiterController {
|
|||
return Poll::Ready(());
|
||||
}
|
||||
ArbiterCommand::Execute(fut) => {
|
||||
crate::spawn(fut);
|
||||
let _ = crate::spawn(fut);
|
||||
}
|
||||
ArbiterCommand::ExecuteFn(f) => {
|
||||
f.call_box();
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::let_underscore_future)]
|
||||
use std::{cell::RefCell, future::Future, io, rc::Rc};
|
||||
|
||||
use async_channel::unbounded;
|
||||
|
@ -159,8 +160,8 @@ where
|
|||
let result = Rc::new(RefCell::new(None));
|
||||
let result_inner = result.clone();
|
||||
crate::block_on(Box::pin(async move {
|
||||
crate::spawn(arb);
|
||||
crate::spawn(arb_controller);
|
||||
let _ = crate::spawn(arb);
|
||||
let _ = crate::spawn(arb_controller);
|
||||
if let Err(e) = f() {
|
||||
*result_inner.borrow_mut() = Some(Err(e));
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Time wheel based timer service.
|
||||
//!
|
||||
//! Inspired by linux kernel timers system
|
||||
#![allow(arithmetic_overflow)]
|
||||
#![allow(arithmetic_overflow, clippy::let_underscore_future)]
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::time::{Duration, Instant, SystemTime};
|
||||
use std::{cmp::max, future::Future, mem, pin::Pin, rc::Rc, task, task::Poll};
|
||||
|
@ -611,7 +611,7 @@ impl TimerDriver {
|
|||
timer.inner.borrow_mut().driver_sleep =
|
||||
Delay::new(Duration::from_millis(timer.next_expiry_ms()));
|
||||
|
||||
crate::spawn(TimerDriver(timer));
|
||||
let _ = crate::spawn(TimerDriver(timer));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -676,7 +676,7 @@ impl LowresTimerDriver {
|
|||
timer.flags.set(flags);
|
||||
timer.inner.borrow_mut().lowres_driver_sleep = Delay::new(LOWRES_RESOLUTION);
|
||||
|
||||
crate::spawn(LowresTimerDriver(timer));
|
||||
let _ = crate::spawn(LowresTimerDriver(timer));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue