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

@ -203,7 +203,7 @@ mod tests {
use std::task::Poll;
use super::*;
use crate::{chain, chain_factory, Service, ServiceCtx};
use crate::{chain, chain_factory};
#[derive(Clone, Debug)]
struct Srv;

View file

@ -193,10 +193,10 @@ impl<'a, S> fmt::Debug for ServiceCtx<'a, S> {
#[cfg(test)]
mod tests {
use ntex_util::future::lazy;
use ntex_util::{channel::condition, time};
use std::task::{Context, Poll};
use std::{cell::Cell, cell::RefCell, future::poll_fn, rc::Rc};
use std::task::Context;
use std::{cell::Cell, cell::RefCell};
use ntex_util::{channel::condition, future::lazy, time};
use super::*;
use crate::Pipeline;
@ -218,6 +218,7 @@ mod tests {
ctx: ServiceCtx<'_, Self>,
) -> Result<Self::Response, Self::Error> {
format!("{:?}", ctx);
#[allow(clippy::clone_on_copy)]
let _ = ctx.clone();
Ok(req)
}

View file

@ -389,7 +389,7 @@ mod tests {
use std::task::Poll;
use super::*;
use crate::{Pipeline, ServiceFactory};
use crate::Pipeline;
#[ntex::test]
async fn test_fn_service() {

View file

@ -72,7 +72,7 @@ where
#[cfg(test)]
mod tests {
use ntex_util::future::lazy;
use std::{rc::Rc, task::Poll};
use std::rc::Rc;
use crate::{chain, fn_service, Pipeline};

View file

@ -119,7 +119,7 @@ mod tests {
use std::{cell::Cell, rc::Rc};
use super::*;
use crate::{fn_service, ServiceFactory};
use crate::fn_service;
#[ntex::test]
async fn test_map_config() {

View file

@ -161,7 +161,7 @@ mod tests {
use ntex_util::future::{lazy, Ready};
use super::*;
use crate::{fn_factory, Pipeline, Service, ServiceCtx, ServiceFactory};
use crate::{fn_factory, Pipeline};
#[derive(Debug, Clone)]
struct Srv(bool);

View file

@ -187,7 +187,7 @@ mod tests {
use std::task::{Context, Poll};
use super::*;
use crate::{fn_service, Pipeline, Service, ServiceCtx, ServiceFactory};
use crate::{fn_service, Pipeline, ServiceCtx};
#[derive(Debug, Clone)]
struct Tr<R>(PhantomData<R>);