mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-04-19 11:24:24 +02:00
refactor: make Ironbar#unique_id
must_use
This commit is contained in:
parent
dedb89bb02
commit
a0cb01ae5f
1 changed files with 1 additions and 0 deletions
|
@ -239,6 +239,7 @@ impl Ironbar {
|
|||
|
||||
/// Gets a `usize` ID value that is unique to the entire Ironbar instance.
|
||||
/// This is just a static `AtomicUsize` that increments every time this function is called.
|
||||
#[must_use]
|
||||
pub fn unique_id() -> usize {
|
||||
static COUNTER: AtomicUsize = AtomicUsize::new(1);
|
||||
COUNTER.fetch_add(1, Ordering::Relaxed)
|
||||
|
|
Loading…
Add table
Reference in a new issue