Skip to content

Commit

Permalink
Merge pull request #135 from iamjpotts/20230831-fix-test-broke-by-typ…
Browse files Browse the repository at this point in the history
…e-alias

Fix test broke by #131
  • Loading branch information
ferristseng authored Aug 31, 2023
2 parents 81da5ec + cb16c0e commit c5ba72d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ipfs-api-prelude/src/from_uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub trait TryFromUri: Sized {
fn from_ipfs_config() -> Option<Self> {
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())
}
}
Expand Down
22 changes: 2 additions & 20 deletions ipfs-api/tests/test_support/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<HttpsConnector<HttpConnector>> {
IpfsClient::from_str(api_url).unwrap()
}
} else if #[cfg(feature = "with-hyper")] {
pub fn build_client(api_url: &str) -> IpfsClient<HttpConnector> {
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<C: IpfsApi>(client: &C) -> Result<VersionResponse, String> {
Expand Down
1 change: 0 additions & 1 deletion ipfs-api/tests/test_support/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c5ba72d

Please sign in to comment.