Downgrade int_like const fn default to trait.

This commit is contained in:
4lDO2
2023-09-06 08:46:58 +02:00
parent f025ece614
commit 68b03d69c0
+6 -6
View File
@@ -72,12 +72,6 @@ macro_rules! int_like {
container: $backing_atomic_type::new(x.get())
}
}
// TODO: Rename/replace with Default trait?
#[allow(dead_code)]
#[inline]
pub const fn default() -> Self {
Self::new($new_type_name::new(0))
}
#[allow(dead_code)]
#[inline]
pub fn load(&self, order: ::core::sync::atomic::Ordering) -> $new_type_name {
@@ -110,6 +104,12 @@ macro_rules! int_like {
}
}
}
impl ::core::default::Default for $new_atomic_type_name {
#[inline]
fn default() -> Self {
Self::new($new_type_name::new(0))
}
}
}
}