From df3121006f6b5f5c578cb9ab2a51ead3d9bfb716 Mon Sep 17 00:00:00 2001 From: Damian Poddebniak Date: Mon, 18 Nov 2024 20:16:52 +0100 Subject: [PATCH] refactor: Use `AtomicUSize` instead of `AtomicU64` in `TagGenerator` --- imap-types/src/core.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imap-types/src/core.rs b/imap-types/src/core.rs index 91efe5b6..9c38fb4e 100644 --- a/imap-types/src/core.rs +++ b/imap-types/src/core.rs @@ -35,7 +35,7 @@ //! ``` #[cfg(feature = "tag_generator")] -use std::sync::atomic::{AtomicU64, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::{ borrow::Cow, fmt::{Debug, Display, Formatter}, @@ -57,7 +57,7 @@ use crate::utils::indicators::{ }; #[cfg(feature = "tag_generator")] -static GLOBAL_TAG_GENERATOR_COUNT: AtomicU64 = AtomicU64::new(0); +static GLOBAL_TAG_GENERATOR_COUNT: AtomicUsize = AtomicUsize::new(0); macro_rules! impl_try_from { ($via:ty, $lifetime:lifetime, $from:ty, $target:ty) => { @@ -1142,7 +1142,7 @@ impl<'a> AsRef for Tag<'a> { #[cfg_attr(docsrs, doc(cfg(feature = "tag_generator")))] #[derive(Debug)] pub struct TagGenerator { - global: u64, + global: usize, counter: u64, }