Skip to content

Commit c5ba72d

Browse files
authored
Merge pull request #135 from iamjpotts/20230831-fix-test-broke-by-type-alias
Fix test broke by #131
2 parents 81da5ec + cb16c0e commit c5ba72d

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

ipfs-api-prelude/src/from_uri.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub trait TryFromUri: Sized {
139139
fn from_ipfs_config() -> Option<Self> {
140140
dirs::home_dir()
141141
.map(|home_dir| home_dir.join(".ipfs").join("api"))
142-
.and_then(|multiaddr_path| fs::read_to_string(&multiaddr_path).ok())
142+
.and_then(|multiaddr_path| fs::read_to_string(multiaddr_path).ok())
143143
.and_then(|multiaddr_str| Self::from_multiaddr_str(&multiaddr_str).ok())
144144
}
145145
}

ipfs-api/tests/test_support/client.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,8 @@ use std::time::Duration;
1010
use ipfs_api::response::VersionResponse;
1111
use ipfs_api::{IpfsApi, IpfsClient, TryFromUri};
1212

13-
#[cfg(feature = "with-hyper")]
14-
use hyper::client::HttpConnector;
15-
16-
#[cfg(feature = "with-hyper-tls")]
17-
use hyper_tls::HttpsConnector;
18-
19-
cfg_if::cfg_if! {
20-
if #[cfg(feature = "with-actix")] {
21-
pub fn build_client(api_url: &str) -> IpfsClient {
22-
IpfsClient::from_str(api_url).unwrap()
23-
}
24-
} else if #[cfg(feature = "with-hyper-tls")] {
25-
pub fn build_client(api_url: &str) -> IpfsClient<HttpsConnector<HttpConnector>> {
26-
IpfsClient::from_str(api_url).unwrap()
27-
}
28-
} else if #[cfg(feature = "with-hyper")] {
29-
pub fn build_client(api_url: &str) -> IpfsClient<HttpConnector> {
30-
IpfsClient::from_str(api_url).unwrap()
31-
}
32-
}
13+
pub fn build_client(api_url: &str) -> IpfsClient {
14+
IpfsClient::from_str(api_url).unwrap()
3315
}
3416

3517
pub async fn wait_for_server<C: IpfsApi>(client: &C) -> Result<VersionResponse, String> {

ipfs-api/tests/test_support/resources.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use std::str::FromStr;
1313
fn strip_path_prefix(path: &Path) -> PathBuf {
1414
let base = path
1515
.components()
16-
.into_iter()
1716
.next()
1817
.unwrap()
1918
.as_os_str()

0 commit comments

Comments
 (0)