Skip to content
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
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ hex = "0.4.3"
serde = "1.0.217"
postcard = { version = "1.1.1", features = ["experimental-derive", "use-std"] }
data-encoding = "2.8.0"
chrono = "0.4.39"
ref-cast = "1.0.24"
arrayvec = "0.7.6"
iroh = { version = "0.95", default-features = false }
Expand All @@ -43,6 +42,14 @@ reflink-copy = { version = "0.1.24", optional = true }
n0-error = "0.1.2"
nested_enum_utils = "0.2.3"

# non-wasm-in-browser dependencies
[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dependencies]
chrono = { version = "0.4.39" }

# wasm-in-browser dependencies
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]
chrono = {version = "0.4.39", default-features = false, features = ["js-sys", "wasmbind", "std"] }

[dev-dependencies]
clap = { version = "4.5.31", features = ["derive"] }
hex = "0.4.3"
Expand Down
7 changes: 2 additions & 5 deletions src/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
//! or you can choose to finish early.
//!
//! [iroh]: https://docs.rs/iroh
use std::{
fmt::{self, Debug},
time::Duration,
};
use std::fmt::{self, Debug};

use bao_tree::{io::fsm::BaoContentItem, ChunkNum};
use fsm::RequestCounters;
use n0_error::Result;
use n0_future::time::Instant;
use n0_future::time::{Duration, Instant};
use serde::{Deserialize, Serialize};
use tracing::{debug, error};

Expand Down
7 changes: 5 additions & 2 deletions src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
//! Note that while using this API directly is fine, the standard way
//! to provide data is to just register a [`crate::BlobsProtocol`] protocol
//! handler with an [`iroh::Endpoint`](iroh::protocol::Router).
use std::{fmt::Debug, future::Future, io, time::Duration};
use std::{fmt::Debug, future::Future, io};

use bao_tree::ChunkRanges;
use iroh::endpoint::{self, ConnectionError, VarInt};
use iroh_io::{AsyncStreamReader, AsyncStreamWriter};
use n0_error::{e, stack_error, Result};
use n0_future::{time::Instant, StreamExt};
use n0_future::{
time::{Duration, Instant},
StreamExt,
};
use serde::{Deserialize, Serialize};
use tokio::select;
use tracing::{debug, debug_span, Instrument};
Expand Down
7 changes: 3 additions & 4 deletions src/store/fs/options.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! Options for configuring the file store.
use std::{
path::{Path, PathBuf},
time::Duration,
};
use std::path::{Path, PathBuf};

use n0_future::time::Duration;

use super::{meta::raw_outboard_size, temp_name};
use crate::{store::gc::GcConfig, Hash};
Expand Down
4 changes: 2 additions & 2 deletions src/store/fs/util/entity_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,10 +819,10 @@ mod tests {
atomic::{AtomicUsize, Ordering},
Arc, Mutex,
},
time::Instant,
};

use atomic_refcell::AtomicRefCell;
use n0_future::time::Instant;

use super::*;

Expand Down Expand Up @@ -1070,10 +1070,10 @@ mod tests {
collections::HashSet,
path::{Path, PathBuf},
sync::{Arc, Mutex},
time::Instant,
};

use atomic_refcell::AtomicRefCell;
use n0_future::time::Instant;

use super::*;

Expand Down
4 changes: 2 additions & 2 deletions src/store/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::HashSet, pin::Pin, sync::Arc};

use bao_tree::ChunkRanges;
use genawaiter::sync::{Co, Gen};
use n0_future::{Stream, StreamExt};
use n0_future::{time::Duration, Stream, StreamExt};
use tracing::{debug, error, info, warn};

use crate::{api::Store, Hash, HashAndFormat};
Expand Down Expand Up @@ -134,7 +134,7 @@ fn gc_sweep<'a>(
#[derive(derive_more::Debug, Clone)]
pub struct GcConfig {
/// Interval in which to run garbage collection.
pub interval: std::time::Duration,
pub interval: Duration,
/// Optional callback to manually add protected blobs.
///
/// The callback is called before each garbage collection run. It gets a `&mut HashSet<Hash>`
Expand Down
2 changes: 1 addition & 1 deletion src/util/connection_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use std::{
atomic::{AtomicUsize, Ordering},
Arc,
},
time::Duration,
};

use iroh::{
Expand All @@ -26,6 +25,7 @@ use iroh::{
use n0_error::{e, stack_error};
use n0_future::{
future::{self},
time::Duration,
FuturesUnordered, MaybeFuture, Stream, StreamExt,
};
use tokio::sync::{
Expand Down
Loading