Skip to content

Commit c1552b7

Browse files
committed
fix(wasm): use n0_future for all time::{Instant, Duration} references
1 parent 45b4dc9 commit c1552b7

File tree

9 files changed

+18
-19
lines changed

9 files changed

+18
-19
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bytes = { version = "1", features = ["serde"] }
1818
derive_more = { version = "2.0.1", features = ["from", "try_from", "into", "debug", "display", "deref", "deref_mut"] }
1919
futures-lite = "2.6.0"
2020
quinn = { package = "iroh-quinn", version = "0.14.0", optional = true }
21-
n0-future = "0.3.0"
21+
n0-future = "0.3.1"
2222
n0-snafu = "0.2.2"
2323
range-collections = { version = "0.4.6", features = ["serde"] }
2424
smallvec = { version = "1", features = ["serde", "const_new"] }

src/get.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616
//! or you can choose to finish early.
1717
//!
1818
//! [iroh]: https://docs.rs/iroh
19-
use std::{
20-
fmt::{self, Debug},
21-
time::Duration,
22-
};
19+
use std::fmt::{self, Debug};
2320

2421
use anyhow::Result;
2522
use bao_tree::{io::fsm::BaoContentItem, ChunkNum};
2623
use fsm::RequestCounters;
27-
use n0_future::time::Instant;
24+
use n0_future::time::{Duration, Instant};
2825
use n0_snafu::SpanTrace;
2926
use nested_enum_utils::common_fields;
3027
use serde::{Deserialize, Serialize};

src/provider.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
//! Note that while using this API directly is fine, the standard way
44
//! to provide data is to just register a [`crate::BlobsProtocol`] protocol
55
//! handler with an [`iroh::Endpoint`](iroh::protocol::Router).
6-
use std::{fmt::Debug, future::Future, io, time::Duration};
6+
use std::{fmt::Debug, future::Future, io};
77

88
use anyhow::Result;
99
use bao_tree::ChunkRanges;
1010
use iroh::endpoint::{self, ConnectionError, VarInt};
1111
use iroh_io::{AsyncStreamReader, AsyncStreamWriter};
12-
use n0_future::{time::Instant, StreamExt};
12+
use n0_future::{
13+
time::{Duration, Instant},
14+
StreamExt,
15+
};
1316
use serde::{Deserialize, Serialize};
1417
use snafu::Snafu;
1518
use tokio::select;

src/store/fs/meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use std::{
55
io,
66
ops::{Bound, Deref, DerefMut},
77
path::PathBuf,
8-
time::SystemTime,
98
};
109

1110
use bao_tree::BaoTree;
1211
use bytes::Bytes;
1312
use irpc::channel::mpsc;
13+
use n0_future::time::SystemTime;
1414
use n0_snafu::SpanTrace;
1515
use nested_enum_utils::common_fields;
1616
use redb::{Database, DatabaseError, ReadableTable};

src/store/fs/options.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
//! Options for configuring the file store.
2-
use std::{
3-
path::{Path, PathBuf},
4-
time::Duration,
5-
};
2+
use std::path::{Path, PathBuf};
3+
4+
use n0_future::time::Duration;
65

76
use super::{meta::raw_outboard_size, temp_name};
87
use crate::{store::gc::GcConfig, Hash};

src/store/fs/util/entity_manager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,10 +819,10 @@ mod tests {
819819
atomic::{AtomicUsize, Ordering},
820820
Arc, Mutex,
821821
},
822-
time::Instant,
823822
};
824823

825824
use atomic_refcell::AtomicRefCell;
825+
use n0_future::time::Instant;
826826

827827
use super::*;
828828

@@ -1070,10 +1070,10 @@ mod tests {
10701070
collections::HashSet,
10711071
path::{Path, PathBuf},
10721072
sync::{Arc, Mutex},
1073-
time::Instant,
10741073
};
10751074

10761075
use atomic_refcell::AtomicRefCell;
1076+
use n0_future::time::Instant;
10771077

10781078
use super::*;
10791079

src/store/gc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ fn gc_sweep<'a>(
134134
#[derive(derive_more::Debug, Clone)]
135135
pub struct GcConfig {
136136
/// Interval in which to run garbage collection.
137-
pub interval: std::time::Duration,
137+
pub interval: n0_future::time::Duration,
138138
/// Optional callback to manually add protected blobs.
139139
///
140140
/// The callback is called before each garbage collection run. It gets a `&mut HashSet<Hash>`

src/util/connection_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::{
1616
atomic::{AtomicUsize, Ordering},
1717
Arc,
1818
},
19-
time::Duration,
2019
};
2120

2221
use iroh::{
@@ -25,6 +24,7 @@ use iroh::{
2524
};
2625
use n0_future::{
2726
future::{self},
27+
time::Duration,
2828
FuturesUnordered, MaybeFuture, Stream, StreamExt,
2929
};
3030
use snafu::Snafu;

0 commit comments

Comments
 (0)