From aeb5ce269231383cd37b2edaedb195c3e4303274 Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Thu, 21 Mar 2024 15:38:12 +0100 Subject: [PATCH] clippy --- src/middlewares/methods/block_tag.rs | 10 +++++----- src/middlewares/methods/inject_params.rs | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/middlewares/methods/block_tag.rs b/src/middlewares/methods/block_tag.rs index 017622c..b71b1ba 100644 --- a/src/middlewares/methods/block_tag.rs +++ b/src/middlewares/methods/block_tag.rs @@ -220,7 +220,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache bypassed, cannot determine finalized block - assert_eq!(bypass_cache(&context), true); + assert!(bypass_cache(&context)); // no replacement assert_eq!(req.params, params); Ok(json!("0x1111")) @@ -280,7 +280,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache bypassed for latest - assert_eq!(bypass_cache(&context), true); + assert!(bypass_cache(&context)); // latest block replaced with block number assert_eq!(req.params, vec![json!("0x1234"), json!("0x4321")]); Ok(json!("0x1111")) @@ -301,7 +301,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache bypassed, block tag not replaced - assert_eq!(bypass_cache(&context), true); + assert!(bypass_cache(&context)); // block tag not replaced assert_eq!(req.params, vec![json!("0x1234"), json!("finalized")]); Ok(json!("0x1111")) @@ -325,7 +325,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache not bypassed, finalized replaced with block number - assert_eq!(bypass_cache(&context), false); + assert!(!bypass_cache(&context)); // block tag replaced with block number assert_eq!(req.params, vec![json!("0x1234"), json!("0x4321")]); Ok(json!("0x1111")) @@ -346,7 +346,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache bypassed for latest - assert_eq!(bypass_cache(&context), true); + assert!(bypass_cache(&context)); // latest block replaced with block number assert_eq!(req.params, vec![json!("0x1234"), json!("0x5432")]); Ok(json!("0x1111")) diff --git a/src/middlewares/methods/inject_params.rs b/src/middlewares/methods/inject_params.rs index 7f83745..b07ecad 100644 --- a/src/middlewares/methods/inject_params.rs +++ b/src/middlewares/methods/inject_params.rs @@ -521,7 +521,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache not bypassed - assert_eq!(bypass_cache(&context), false); + assert!(!bypass_cache(&context)); // block number is not finalized assert_eq!(req.params, vec![json!("0x1234"), json!(0x4321)]); Ok(json!("0x1111")) @@ -556,7 +556,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache bypassed - assert_eq!(bypass_cache(&context), true); + assert!(bypass_cache(&context)); // block number is injected assert_eq!(req.params, vec![json!("0x1234"), json!(0x5432)]); Ok(json!("0x1111")) @@ -578,7 +578,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache bypassed - assert_eq!(bypass_cache(&context), true); + assert!(bypass_cache(&context)); // params not changed assert_eq!(req.params, vec![json!("0x1234"), json!(0x5432)]); Ok(json!("0x1111")) @@ -600,7 +600,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache not bypassed - assert_eq!(bypass_cache(&context), false); + assert!(!bypass_cache(&context)); // params not changed assert_eq!(req.params, vec![json!("0x1234"), json!(0x4321)]); Ok(json!("0x1111")) @@ -626,7 +626,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache not bypassed - assert_eq!(bypass_cache(&context), false); + assert!(!bypass_cache(&context)); // params not changed assert_eq!(req.params, vec![json!("0x1234"), json!(0x4321), json!("0xabcd")]); Ok(json!("0x1111")) @@ -649,7 +649,7 @@ mod tests { Box::new(move |req: CallRequest, context| { async move { // cache bypassed - assert_eq!(bypass_cache(&context), true); + assert!(bypass_cache(&context)); // params not changed assert_eq!(req.params, vec![json!("0x1234"), json!(0x5432), json!("0xabcd")]); Ok(json!("0x1111"))