From af93d4aa3dceb9c6ff8e12d807ff06e5de8fe983 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Sun, 12 May 2024 11:43:30 +0200 Subject: [PATCH] happy clippy --- src/provider/mod.rs | 2 +- src/util.rs | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/provider/mod.rs b/src/provider/mod.rs index 994ec6ff92..3e9ff5a051 100644 --- a/src/provider/mod.rs +++ b/src/provider/mod.rs @@ -125,7 +125,7 @@ impl Builder { } impl> Builder { - /// + /// Set the rpc endpoint. pub fn rpc_endpoint>(self, value: E2) -> Builder { Builder { bind_addr: self.bind_addr, diff --git a/src/util.rs b/src/util.rs index 0a9d3bf173..3b9a87eaf7 100644 --- a/src/util.rs +++ b/src/util.rs @@ -233,25 +233,6 @@ pub fn canonicalize_path(path: impl AsRef) -> anyhow::Result { Ok(parts.join("/")) } -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_hash() { - let data = b"hello world"; - let hash = Hash::new(data); - - let encoded = hash.to_string(); - assert_eq!(encoded.parse::().unwrap(), hash); - } - - #[test] - fn test_canonicalize_path() { - assert_eq!(canonicalize_path("foo/bar").unwrap(), "foo/bar"); - } -} - pub(crate) struct ProgressReader { inner: R, offset: u64, @@ -315,3 +296,22 @@ impl Progress { Ok(()) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_hash() { + let data = b"hello world"; + let hash = Hash::new(data); + + let encoded = hash.to_string(); + assert_eq!(encoded.parse::().unwrap(), hash); + } + + #[test] + fn test_canonicalize_path() { + assert_eq!(canonicalize_path("foo/bar").unwrap(), "foo/bar"); + } +}