Clippy warnings (#305)

This commit is contained in:
Nikolay Kim 2024-03-06 20:33:20 +06:00
parent 68e158d877
commit 661c5ea1fa
62 changed files with 103 additions and 110 deletions

View file

@ -252,8 +252,7 @@ impl<T> SendError<T> {
#[cfg(test)]
mod tests {
use super::*;
use crate::{future::lazy, future::stream_recv, Stream};
use futures_sink::Sink;
use crate::{future::lazy, future::stream_recv};
#[ntex_macros::rt_test2]
async fn test_mpsc() {

View file

@ -287,8 +287,8 @@ where
#[cfg(test)]
mod tests {
use ntex_service::{apply, fn_factory, Pipeline, Service, ServiceFactory};
use std::{rc::Rc, task::Context, task::Poll, time::Duration};
use ntex_service::{apply, fn_factory, Pipeline, ServiceFactory};
use std::{rc::Rc, time::Duration};
use super::*;
use crate::future::lazy;

View file

@ -1,4 +1,4 @@
use std::{any::Any, any::TypeId, fmt, iter::Extend};
use std::{any::Any, any::TypeId, fmt};
#[derive(Default)]
/// A type map of request extensions.

View file

@ -90,8 +90,8 @@ where
#[cfg(test)]
mod tests {
use ntex_service::{apply, fn_factory, Pipeline, Service, ServiceCtx, ServiceFactory};
use std::{cell::RefCell, task::Poll, time::Duration};
use ntex_service::{apply, fn_factory, Pipeline, ServiceFactory};
use std::{cell::RefCell, time::Duration};
use super::*;
use crate::{channel::oneshot, future::lazy};

View file

@ -138,8 +138,6 @@ where
#[cfg(test)]
mod tests {
use ntex_service::ServiceFactory;
use super::*;
use crate::future::lazy;

View file

@ -81,8 +81,8 @@ where
#[cfg(test)]
mod tests {
use ntex_service::{apply, fn_factory, Pipeline, Service, ServiceCtx, ServiceFactory};
use std::{cell::RefCell, task::Poll, time::Duration};
use ntex_service::{apply, fn_factory, Pipeline, ServiceFactory};
use std::{cell::RefCell, time::Duration};
use super::*;
use crate::{channel::oneshot, future::lazy};

View file

@ -147,9 +147,9 @@ where
#[cfg(test)]
mod tests {
use std::{fmt, time::Duration};
use std::time::Duration;
use ntex_service::{apply, fn_factory, Pipeline, Service, ServiceFactory};
use ntex_service::{apply, fn_factory, Pipeline, ServiceFactory};
use super::*;
use crate::future::lazy;

View file

@ -232,8 +232,7 @@ variant_impl_and!(VariantFactory7, VariantFactory8, V8, V8R, v8, (V2, V3, V4, V5
#[cfg(test)]
mod tests {
use ntex_service::{fn_factory, Service, ServiceFactory};
use std::task::{Context, Poll};
use ntex_service::fn_factory;
use super::*;
use crate::future::lazy;

View file

@ -339,6 +339,7 @@ impl crate::Stream for Interval {
}
#[cfg(test)]
#[allow(clippy::let_underscore_future)]
mod tests {
use futures_util::StreamExt;
use std::time;

View file

@ -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));
}
}