mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 04:47:39 +03:00
Clippy warnings (#382)
This commit is contained in:
parent
2cbc42730b
commit
d39611d246
19 changed files with 33 additions and 43 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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(()));
|
||||
}
|
||||
|
|
|
@ -94,6 +94,6 @@ mod tests {
|
|||
pipe.shutdown().await;
|
||||
assert!(is_called.get());
|
||||
|
||||
format!("{:?}", pipe);
|
||||
let _ = format!("{:?}", pipe);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ mod tests {
|
|||
|
||||
let _ = factory.create(&10).await;
|
||||
assert_eq!(item.get(), 11);
|
||||
format!("{:?}", factory);
|
||||
let _ = format!("{:?}", factory);
|
||||
}
|
||||
|
||||
#[ntex::test]
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue