From ba53395d88f9820fcd26b05192845d2eca365217 Mon Sep 17 00:00:00 2001 From: Ferris Tseng Date: Sat, 16 May 2020 17:32:06 -0400 Subject: better handling of multiaddrs --- ipfs-api/src/client/internal.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ipfs-api/src/client/internal.rs') diff --git a/ipfs-api/src/client/internal.rs b/ipfs-api/src/client/internal.rs index 5667ab2..fcc4ddb 100644 --- a/ipfs-api/src/client/internal.rs +++ b/ipfs-api/src/client/internal.rs @@ -79,7 +79,7 @@ impl Default for IpfsClient { /// fn default() -> IpfsClient { Self::from_ipfs_config() - .unwrap_or_else(|| Self::from_host_and_port("localhost", 5001).unwrap()) + .unwrap_or_else(|| Self::from_host_and_port(Scheme::HTTP, "localhost", 5001).unwrap()) } } @@ -88,7 +88,7 @@ impl IpfsClient { /// #[deprecated( since = "0.7.2", - note = "Please use [`client::TryFromUri::from_host_and_port`]" + note = "Please use [`client::TryFromUri::from_host_and_port`]. Removing in next major version." )] pub fn new(host: &str, port: u16) -> Result { let uri = format!("http://{}:{}", host, port); @@ -97,14 +97,17 @@ impl IpfsClient { Self::from_str(&uri[..]) } - #[deprecated(since = "0.7.2", note = "Please use [`client::TryFromUri::from_uri`]")] + #[deprecated( + since = "0.7.2", + note = "Please use [`client::TryFromUri::from_uri`]. Removing in next major version." + )] pub fn new_from_uri(uri: &str) -> Result { Self::from_str(uri) } #[deprecated( since = "0.7.2", - note = "Please use [`client::TryFromUri::from_socket`]" + note = "Please use [`client::TryFromUri::from_socket`]. Removing in next major version." )] pub fn from(socket_addr: SocketAddr) -> IpfsClient { Self::from_socket(Scheme::HTTP, socket_addr).unwrap() -- cgit v1.2.3