Skip to content

Commit 884ddfb

Browse files
torokati44djc
authored andcommitted
Replace instant with web-time
1 parent 5396704 commit 884ddfb

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ futures = "0.3" # so the doctest for wrap_stream is nice
3232
pretty_assertions = "1.4.0"
3333

3434
[target.'cfg(target_arch = "wasm32")'.dependencies]
35-
instant = "0.1"
35+
web-time = "1.1.0"
3636

3737
[features]
3838
default = ["unicode-width", "console/unicode-width"]

src/draw_target.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::time::Instant;
99

1010
use console::Term;
1111
#[cfg(target_arch = "wasm32")]
12-
use instant::Instant;
12+
use web_time::Instant;
1313

1414
use crate::multi::{MultiProgressAlignment, MultiState};
1515
use crate::TermLike;

src/multi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::draw_target::{
1010
};
1111
use crate::progress_bar::ProgressBar;
1212
#[cfg(target_arch = "wasm32")]
13-
use instant::Instant;
13+
use web_time::Instant;
1414

1515
/// Manages multiple progress bars from different threads
1616
#[derive(Debug, Clone)]

src/progress_bar.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use std::time::Duration;
77
use std::time::Instant;
88
use std::{fmt, io, thread};
99

10-
#[cfg(target_arch = "wasm32")]
11-
use instant::Instant;
1210
#[cfg(test)]
1311
use once_cell::sync::Lazy;
12+
#[cfg(target_arch = "wasm32")]
13+
use web_time::Instant;
1414

1515
use crate::draw_target::ProgressDrawTarget;
1616
use crate::state::{AtomicPosition, BarState, ProgressFinish, Reset, TabExpandedString};

src/state.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use std::time::Duration;
55
#[cfg(not(target_arch = "wasm32"))]
66
use std::time::Instant;
77

8-
#[cfg(target_arch = "wasm32")]
9-
use instant::Instant;
108
use portable_atomic::{AtomicU64, AtomicU8, Ordering};
9+
#[cfg(target_arch = "wasm32")]
10+
use web_time::Instant;
1111

1212
use crate::draw_target::ProgressDrawTarget;
1313
use crate::style::ProgressStyle;

src/style.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use std::mem;
55
use std::time::Instant;
66

77
use console::{measure_text_width, Style};
8-
#[cfg(target_arch = "wasm32")]
9-
use instant::Instant;
108
#[cfg(feature = "unicode-segmentation")]
119
use unicode_segmentation::UnicodeSegmentation;
10+
#[cfg(target_arch = "wasm32")]
11+
use web_time::Instant;
1212

1313
use crate::format::{
1414
BinaryBytes, DecimalBytes, FormattedDuration, HumanBytes, HumanCount, HumanDuration,

0 commit comments

Comments
 (0)