Skip to content
Open
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
141 changes: 90 additions & 51 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ clap = { version = "4.4.4", features = ["derive", "env"], optional = true }
data-encoding = "2.3.2"
derive_builder = "0.10.2"
derive_more = "0.99.17"
ed25519-dalek = { version = "1.0.1", optional = true }
ed25519-dalek = { version = "2.1.1", optional = true }
futures = "0.3.19"
indexmap = "1.9.3"
lazy_static = "1.4.0"
Expand Down
2 changes: 1 addition & 1 deletion src/bundlr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ where
pub fn build(self) -> Result<Bundlr<Currency>, BuilderError> {
let url = self.url.unwrap_or(Url::parse(BUNDLR_DEFAULT_URL).unwrap());

let client = self.client.unwrap_or_else(reqwest::Client::new);
let client = self.client.unwrap_or_default();

let pub_info = match self.pub_info {
Some(p) => p,
Expand Down
4 changes: 1 addition & 3 deletions src/deep_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ use crate::{
consts::{BLOB_AS_BUFFER, LIST_AS_BUFFER},
error::BundlrError,
};
use futures::{Stream, TryStream, TryStreamExt};
use futures::{Stream, TryStreamExt};

pub enum DeepHashChunk<'a> {
Chunk(Bytes),
Stream(&'a mut Pin<Box<dyn Stream<Item = anyhow::Result<Bytes>>>>),
Chunks(Vec<DeepHashChunk<'a>>),
}

trait Foo: Stream<Item = anyhow::Result<Bytes>> + TryStream {}

pub async fn deep_hash(chunk: DeepHashChunk<'_>) -> Result<Bytes, BundlrError> {
match chunk {
DeepHashChunk::Chunk(b) => {
Expand Down
3 changes: 0 additions & 3 deletions src/deep_hash_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ use crate::{
deep_hash::DeepHashChunk,
error::BundlrError,
};
use futures::{Stream, TryStream};

trait Foo: Stream<Item = anyhow::Result<Bytes>> + TryStream {}

pub fn deep_hash_sync(chunk: DeepHashChunk) -> Result<Bytes, BundlrError> {
match chunk {
Expand Down
Loading