Skip to content

Commit 0a11da4

Browse files
authored
fix(ipfs): use from_str IPFS client constructor (#673)
Signed-off-by: Lorenzo Delgado <[email protected]>
1 parent fb1d51b commit 0a11da4

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/dips/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ futures = "0.3"
2626
http = "0.2"
2727
prost = { workspace = true, optional = true }
2828
ipfs-api-backend-hyper = { version = "0.6.0", features = ["with-send-sync", "with-hyper-tls"] }
29-
ipfs-api-prelude = { version = "0.6.0", features = ["with-send-sync"] }
3029
serde_yaml.workspace = true
3130
serde.workspace = true
3231
sqlx = { workspace = true, optional = true }

crates/dips/src/ipfs.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
// Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use std::{str::FromStr, sync::Arc};
4+
use std::sync::Arc;
55

66
use async_trait::async_trait;
77
use derivative::Derivative;
88
use futures::TryStreamExt;
9-
use http::Uri;
10-
use ipfs_api_prelude::{IpfsApi, TryFromUri};
9+
use ipfs_api_backend_hyper::{IpfsApi, TryFromUri};
1110
use serde::Deserialize;
12-
use tracing;
1311

1412
use crate::DipsError;
1513

@@ -34,11 +32,8 @@ pub struct IpfsClient {
3432

3533
impl IpfsClient {
3634
pub fn new(url: &str) -> anyhow::Result<Self> {
37-
Ok(Self {
38-
client: ipfs_api_backend_hyper::IpfsClient::build_with_base_uri(
39-
Uri::from_str(url).map_err(anyhow::Error::from)?,
40-
),
41-
})
35+
let client = ipfs_api_backend_hyper::IpfsClient::from_str(url)?;
36+
Ok(Self { client })
4237
}
4338
}
4439

0 commit comments

Comments
 (0)