Skip to content

Commit e151436

Browse files
committed
fix(wasm): std::time::Duration -> n0_future::time::Duration
1 parent dbbe4ce commit e151436

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

src/actor.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ use std::{
44
collections::{hash_map, HashMap},
55
num::NonZeroU64,
66
sync::Arc,
7-
time::Duration,
87
};
98

109
use anyhow::{anyhow, Context, Result};
1110
use bytes::Bytes;
1211
use futures_util::FutureExt;
1312
use iroh_blobs::Hash;
1413
use irpc::channel::mpsc;
15-
use n0_future::task::JoinSet;
14+
use n0_future::{task::JoinSet, time::Duration};
1615
use serde::{Deserialize, Serialize};
1716
use tokio::sync::oneshot;
1817
#[cfg(wasm_browser)]

src/net.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Network implementation of the iroh-docs protocol
22
3-
use std::{future::Future, time::Duration};
3+
use std::future::Future;
44

55
use iroh::{Endpoint, EndpointAddr, PublicKey};
6-
use n0_future::time::Instant;
6+
use n0_future::time::{Duration, Instant};
77
use serde::{Deserialize, Serialize};
88
use tracing::{debug, error_span, trace, Instrument};
99

src/sync.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ use std::{
1111
fmt::Debug,
1212
ops::{Deref, DerefMut},
1313
sync::Arc,
14-
time::Duration,
1514
};
1615

1716
use bytes::{Bytes, BytesMut};
1817
use ed25519_dalek::{Signature, SignatureError};
1918
use iroh_blobs::Hash;
20-
use n0_future::{time::SystemTime, IterExt};
19+
use n0_future::{
20+
time::{Duration, SystemTime},
21+
IterExt,
22+
};
2123
use serde::{Deserialize, Serialize};
2224

2325
pub use crate::heads::AuthorHeads;

tests/gc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#![allow(unused)]
22

3-
use std::{path::PathBuf, time::Duration};
3+
use std::path::PathBuf;
44

55
use anyhow::Result;
66
use bytes::Bytes;
77
use futures_lite::StreamExt;
88
use iroh_blobs::api::blobs::ImportMode;
9+
use n0_future::time::Duration;
910
use rand::RngCore;
1011
use testdir::testdir;
1112
use util::Node;

tests/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::HashMap, future::Future, sync::Arc, time::Duration};
1+
use std::{collections::HashMap, future::Future, sync::Arc};
22

33
use anyhow::{anyhow, bail, Context, Result};
44
use bytes::Bytes;
@@ -15,7 +15,7 @@ use iroh_docs::{
1515
store::{DownloadPolicy, FilterKind, Query},
1616
AuthorId, ContentStatus, Entry,
1717
};
18-
use n0_future::time::Instant;
18+
use n0_future::time::{Duration, Instant};
1919
use rand::{CryptoRng, Rng, SeedableRng};
2020
#[cfg(feature = "fs-store")]
2121
use tempfile::tempdir;

tests/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub struct Builder {
6767
use_n0_discovery: bool,
6868
storage: Storage,
6969
// node_discovery: Option<Box<dyn Discovery>>,
70-
gc_interval: Option<std::time::Duration>,
70+
gc_interval: Option<n0_future::time::Duration>,
7171
#[debug(skip)]
7272
register_gc_done_cb: Option<Box<dyn Fn() + Send + 'static>>,
7373
bind_random_port: bool,
@@ -165,7 +165,7 @@ impl Builder {
165165
self
166166
}
167167

168-
pub fn gc_interval(mut self, value: Option<std::time::Duration>) -> Self {
168+
pub fn gc_interval(mut self, value: Option<n0_future::time::Duration>) -> Self {
169169
self.gc_interval = value;
170170
self
171171
}

0 commit comments

Comments
 (0)