Skip to content

Commit

Permalink
Replace instant with web-time
Browse files Browse the repository at this point in the history
  • Loading branch information
torokati44 authored and djc committed Nov 11, 2024
1 parent 5396704 commit 884ddfb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ futures = "0.3" # so the doctest for wrap_stream is nice
pretty_assertions = "1.4.0"

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

[features]
default = ["unicode-width", "console/unicode-width"]
Expand Down
2 changes: 1 addition & 1 deletion src/draw_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::time::Instant;

use console::Term;
#[cfg(target_arch = "wasm32")]
use instant::Instant;
use web_time::Instant;

use crate::multi::{MultiProgressAlignment, MultiState};
use crate::TermLike;
Expand Down
2 changes: 1 addition & 1 deletion src/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::draw_target::{
};
use crate::progress_bar::ProgressBar;
#[cfg(target_arch = "wasm32")]
use instant::Instant;
use web_time::Instant;

/// Manages multiple progress bars from different threads
#[derive(Debug, Clone)]
Expand Down
4 changes: 2 additions & 2 deletions src/progress_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use std::time::Duration;
use std::time::Instant;
use std::{fmt, io, thread};

#[cfg(target_arch = "wasm32")]
use instant::Instant;
#[cfg(test)]
use once_cell::sync::Lazy;
#[cfg(target_arch = "wasm32")]
use web_time::Instant;

use crate::draw_target::ProgressDrawTarget;
use crate::state::{AtomicPosition, BarState, ProgressFinish, Reset, TabExpandedString};
Expand Down
4 changes: 2 additions & 2 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use std::time::Duration;
#[cfg(not(target_arch = "wasm32"))]
use std::time::Instant;

#[cfg(target_arch = "wasm32")]
use instant::Instant;
use portable_atomic::{AtomicU64, AtomicU8, Ordering};
#[cfg(target_arch = "wasm32")]
use web_time::Instant;

use crate::draw_target::ProgressDrawTarget;
use crate::style::ProgressStyle;
Expand Down
4 changes: 2 additions & 2 deletions src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use std::mem;
use std::time::Instant;

use console::{measure_text_width, Style};
#[cfg(target_arch = "wasm32")]
use instant::Instant;
#[cfg(feature = "unicode-segmentation")]
use unicode_segmentation::UnicodeSegmentation;
#[cfg(target_arch = "wasm32")]
use web_time::Instant;

use crate::format::{
BinaryBytes, DecimalBytes, FormattedDuration, HumanBytes, HumanCount, HumanDuration,
Expand Down

0 comments on commit 884ddfb

Please sign in to comment.