From 94cc569589c85c21bf832859b979ffafa3f7d225 Mon Sep 17 00:00:00 2001 From: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:04:24 -0500 Subject: [PATCH 1/2] Fix clippy errors --- ipfs-api-prelude/src/from_uri.rs | 2 +- ipfs-api/tests/test_support/resources.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ipfs-api-prelude/src/from_uri.rs b/ipfs-api-prelude/src/from_uri.rs index 7cd033b..ac5fcb3 100644 --- a/ipfs-api-prelude/src/from_uri.rs +++ b/ipfs-api-prelude/src/from_uri.rs @@ -139,7 +139,7 @@ pub trait TryFromUri: Sized { fn from_ipfs_config() -> Option { dirs::home_dir() .map(|home_dir| home_dir.join(".ipfs").join("api")) - .and_then(|multiaddr_path| fs::read_to_string(&multiaddr_path).ok()) + .and_then(|multiaddr_path| fs::read_to_string(multiaddr_path).ok()) .and_then(|multiaddr_str| Self::from_multiaddr_str(&multiaddr_str).ok()) } } diff --git a/ipfs-api/tests/test_support/resources.rs b/ipfs-api/tests/test_support/resources.rs index 3a743d5..b25c43c 100644 --- a/ipfs-api/tests/test_support/resources.rs +++ b/ipfs-api/tests/test_support/resources.rs @@ -13,7 +13,6 @@ use std::str::FromStr; fn strip_path_prefix(path: &Path) -> PathBuf { let base = path .components() - .into_iter() .next() .unwrap() .as_os_str() From cb16c0e2f165e7802300adfa64b13448c55e2010 Mon Sep 17 00:00:00 2001 From: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> Date: Thu, 31 Aug 2023 10:50:56 -0500 Subject: [PATCH 2/2] Fix test broke by #131 --- ipfs-api/tests/test_support/client.rs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/ipfs-api/tests/test_support/client.rs b/ipfs-api/tests/test_support/client.rs index 808bb04..47f613f 100644 --- a/ipfs-api/tests/test_support/client.rs +++ b/ipfs-api/tests/test_support/client.rs @@ -10,26 +10,8 @@ use std::time::Duration; use ipfs_api::response::VersionResponse; use ipfs_api::{IpfsApi, IpfsClient, TryFromUri}; -#[cfg(feature = "with-hyper")] -use hyper::client::HttpConnector; - -#[cfg(feature = "with-hyper-tls")] -use hyper_tls::HttpsConnector; - -cfg_if::cfg_if! { - if #[cfg(feature = "with-actix")] { - pub fn build_client(api_url: &str) -> IpfsClient { - IpfsClient::from_str(api_url).unwrap() - } - } else if #[cfg(feature = "with-hyper-tls")] { - pub fn build_client(api_url: &str) -> IpfsClient> { - IpfsClient::from_str(api_url).unwrap() - } - } else if #[cfg(feature = "with-hyper")] { - pub fn build_client(api_url: &str) -> IpfsClient { - IpfsClient::from_str(api_url).unwrap() - } - } +pub fn build_client(api_url: &str) -> IpfsClient { + IpfsClient::from_str(api_url).unwrap() } pub async fn wait_for_server(client: &C) -> Result {