Skip to content

Fix test broke by #131 #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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