Clippy warnings (#382)

This commit is contained in:
Nikolay Kim 2024-07-16 22:13:33 +02:00 committed by GitHub
parent 2cbc42730b
commit d39611d246
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 33 additions and 43 deletions

View file

@ -278,7 +278,7 @@ mod tests {
let res = srv.call("srv").await;
assert!(res.is_ok());
assert_eq!(res.unwrap(), ("srv", ()));
format!("{:?}", srv);
let _ = format!("{:?}", srv);
}
#[ntex::test]
@ -301,7 +301,7 @@ mod tests {
let res = srv.call("srv").await;
assert!(res.is_ok());
assert_eq!(res.unwrap(), ("srv", ()));
format!("{:?}", new_srv);
let _ = format!("{:?}", new_srv);
assert!(Err == Err::from(()));
}
@ -322,6 +322,6 @@ mod tests {
let res = srv.call("srv").await;
assert!(res.is_ok());
assert_eq!(res.unwrap(), ("srv", ()));
format!("{:?}", new_srv);
let _ = format!("{:?}", new_srv);
}
}

View file

@ -256,7 +256,7 @@ mod tests {
req: &'static str,
ctx: ServiceCtx<'_, Self>,
) -> Result<Self::Response, Self::Error> {
format!("{:?}", ctx);
let _ = format!("{:?}", ctx);
#[allow(clippy::clone_on_copy)]
let _ = ctx.clone();
Ok(req)

View file

@ -380,20 +380,20 @@ mod tests {
#[ntex::test]
async fn test_fn_service() {
let new_srv = fn_service(|()| async { Ok::<_, ()>("srv") }).clone();
format!("{:?}", new_srv);
let _ = format!("{:?}", new_srv);
let srv = Pipeline::new(new_srv.create(()).await.unwrap()).bind();
let res = srv.call(()).await;
assert_eq!(lazy(|cx| srv.poll_ready(cx)).await, Poll::Ready(Ok(())));
assert!(res.is_ok());
assert_eq!(res.unwrap(), "srv");
format!("{:?}", srv);
let _ = format!("{:?}", srv);
let srv2 = Pipeline::new(new_srv.clone()).bind();
let res = srv2.call(()).await;
assert!(res.is_ok());
assert_eq!(res.unwrap(), "srv");
format!("{:?}", srv2);
let _ = format!("{:?}", srv2);
assert_eq!(lazy(|cx| srv2.poll_shutdown(cx)).await, Poll::Ready(()));
}

View file

@ -94,6 +94,6 @@ mod tests {
pipe.shutdown().await;
assert!(is_called.get());
format!("{:?}", pipe);
let _ = format!("{:?}", pipe);
}
}

View file

@ -184,7 +184,7 @@ mod tests {
srv.shutdown().await;
assert_eq!(cnt_sht.get(), 1);
format!("{:?}", srv);
let _ = format!("{:?}", srv);
}
#[ntex::test]
@ -208,7 +208,7 @@ mod tests {
assert!(res.is_ok());
assert_eq!(res.unwrap(), ("ok"));
format!("{:?}", new_srv);
let _ = format!("{:?}", new_srv);
}
#[ntex::test]
@ -222,6 +222,6 @@ mod tests {
assert!(res.is_ok());
assert_eq!(res.unwrap(), ("ok"));
format!("{:?}", new_srv);
let _ = format!("{:?}", new_srv);
}
}

View file

@ -134,7 +134,7 @@ mod tests {
let _ = factory.create(&10).await;
assert_eq!(item.get(), 11);
format!("{:?}", factory);
let _ = format!("{:?}", factory);
}
#[ntex::test]

View file

@ -209,7 +209,7 @@ mod tests {
assert!(res.is_err());
assert_eq!(res.err().unwrap(), "error");
format!("{:?}", srv);
let _ = format!("{:?}", srv);
}
#[ntex::test]
@ -223,7 +223,7 @@ mod tests {
assert!(res.is_err());
assert_eq!(res.err().unwrap(), "error");
format!("{:?}", srv);
let _ = format!("{:?}", srv);
}
#[ntex::test]
@ -236,7 +236,7 @@ mod tests {
let res = srv.call(()).await;
assert!(res.is_err());
assert_eq!(res.err().unwrap(), "error");
format!("{:?}", new_srv);
let _ = format!("{:?}", new_srv);
}
#[ntex::test]
@ -250,6 +250,6 @@ mod tests {
let res = srv.call(()).await;
assert!(res.is_err());
assert_eq!(res.err().unwrap(), "error");
format!("{:?}", new_srv);
let _ = format!("{:?}", new_srv);
}
}

View file

@ -88,7 +88,7 @@ mod tests {
assert!(factory.create(&true).await.is_err());
assert!(factory.create(&false).await.is_ok());
format!("{:?}", factory);
let _ = format!("{:?}", factory);
}
#[ntex::test]
@ -108,6 +108,6 @@ mod tests {
assert!(factory.create(&true).await.is_err());
assert!(factory.create(&false).await.is_ok());
format!("{:?}", factory);
let _ = format!("{:?}", factory);
}
}

View file

@ -244,7 +244,7 @@ mod tests {
let res = srv.call(10).await;
assert!(res.is_ok());
assert_eq!(res.unwrap(), 20);
format!("{:?} {:?}", factory, srv);
let _ = format!("{:?} {:?}", factory, srv);
assert_eq!(srv.ready().await, Ok(()));
srv.shutdown().await;
@ -259,7 +259,7 @@ mod tests {
let res = srv.call(10).await;
assert!(res.is_ok());
assert_eq!(res.unwrap(), 20);
format!("{:?} {:?}", factory, srv);
let _ = format!("{:?} {:?}", factory, srv);
assert_eq!(srv.ready().await, Ok(()));
}