Skip to content

Commit 9b95365

Browse files
committed
more time fixes
1 parent df4c3ab commit 9b95365

File tree

9 files changed

+13
-23
lines changed

9 files changed

+13
-23
lines changed

src/actor.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ use irpc::channel::mpsc;
1515
use n0_future::task::JoinSet;
1616
use serde::{Deserialize, Serialize};
1717
use tokio::sync::oneshot;
18-
use tracing::{debug, error, error_span, trace, warn};
19-
2018
#[cfg(wasm_browser)]
2119
use tracing::Instrument;
20+
use tracing::{debug, error, error_span, trace, warn};
2221

2322
use crate::{
2423
api::{

src/engine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,9 @@ impl DefaultAuthorStorage {
372372
}
373373
#[cfg(feature = "fs-store")]
374374
Self::Persistent(ref path) => {
375-
use anyhow::Context;
376375
use std::str::FromStr;
376+
377+
use anyhow::Context;
377378
if path.exists() {
378379
let data = tokio::fs::read_to_string(path).await.with_context(|| {
379380
format!(

src/engine/live.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::{
44
collections::{HashMap, HashSet},
55
sync::Arc,
66
};
7-
use n0_future::time::SystemTime;
87

98
use anyhow::{Context, Result};
109
use futures_lite::FutureExt;
@@ -20,6 +19,7 @@ use iroh_blobs::{
2019
Hash, HashAndFormat,
2120
};
2221
use iroh_gossip::net::Gossip;
22+
use n0_future::time::SystemTime;
2323
use serde::{Deserialize, Serialize};
2424
use tokio::{
2525
sync::{self, mpsc, oneshot},

src/engine/state.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
use std::{
2-
collections::BTreeMap,
3-
time::Instant,
4-
};
5-
use n0_future::time::SystemTime;
1+
use std::collections::BTreeMap;
62

73
use anyhow::Result;
84
use iroh::EndpointId;
5+
use n0_future::time::{Instant, SystemTime};
96
use serde::{Deserialize, Serialize};
107
use tracing::{debug, warn};
118

src/net.rs

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

85
use iroh::{Endpoint, EndpointAddr, PublicKey};
6+
use n0_future::time::Instant;
97
use serde::{Deserialize, Serialize};
108
use tracing::{debug, error_span, trace, Instrument};
119

src/store/fs/tables.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#![allow(missing_docs)]
22
// Table Definitions
33

4-
use std::time::Instant;
5-
64
use bytes::Bytes;
5+
use n0_future::time::Instant;
76
use redb::{
87
MultimapTable, MultimapTableDefinition, ReadOnlyMultimapTable, ReadOnlyTable, ReadTransaction,
98
Table, TableDefinition, WriteTransaction,

src/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77
// This is going to change!
88

9-
use n0_future::{time::SystemTime, IterExt};
109
use std::{
1110
cmp::Ordering,
1211
fmt::Debug,
@@ -18,6 +17,7 @@ use std::{
1817
use bytes::{Bytes, BytesMut};
1918
use ed25519_dalek::{Signature, SignatureError};
2019
use iroh_blobs::Hash;
20+
use n0_future::{time::SystemTime, IterExt};
2121
use serde::{Deserialize, Serialize};
2222

2323
pub use crate::heads::AuthorHeads;

tests/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ async fn test_default_author_persist() -> TestResult<()> {
216216
// somehow the blob store is not shutdown correctly (yet?) on macos.
217217
// so we give it some time until we find a proper fix.
218218
#[cfg(target_os = "macos")]
219-
n0_future::time::sleep(std::time::Duration::from_secs(1)).await;
219+
n0_future::time::sleep(std::time::Duration::from_secs(1)).await;
220220

221221
tokio::fs::remove_file(iroh_root.join("default-author")).await?;
222222
drop(iroh);

tests/sync.rs

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

83
use anyhow::{anyhow, bail, Context, Result};
94
use bytes::Bytes;
@@ -20,6 +15,7 @@ use iroh_docs::{
2015
store::{DownloadPolicy, FilterKind, Query},
2116
AuthorId, ContentStatus, Entry,
2217
};
18+
use n0_future::time::Instant;
2319
use rand::{CryptoRng, Rng, SeedableRng};
2420
use tempfile::tempdir;
2521
use tracing::{debug, error_span, info, Instrument};

0 commit comments

Comments
 (0)