Skip to content

Commit

Permalink
feat: add progress::AtomicStep to allow referring to it.
Browse files Browse the repository at this point in the history
Previously, only `StepShared` was available, which implies an `Arc`.
  • Loading branch information
Byron committed Sep 4, 2023
1 parent 6b94f28 commit 0705a73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/progress/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ pub const UNKNOWN: Id = *b"\0\0\0\0";
/// The amount of steps a progress can make
pub type Step = usize;

/// The amount of steps a progress can make, for threadsafe counting.
pub type AtomicStep = AtomicUsize;

/// As step, but shareable.
pub type StepShared = Arc<AtomicUsize>;
pub type StepShared = Arc<AtomicStep>;

/// Indicate whether a progress can or cannot be made.
#[derive(Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
Expand Down

0 comments on commit 0705a73

Please sign in to comment.