rename the atomic::name to unit_name

This commit is contained in:
Tamo 2024-12-11 18:03:06 +01:00
parent 9245c89cfe
commit c5536c37b5
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69

View File

@ -65,7 +65,7 @@ pub trait NamedStep: 'static + Send + Sync + Default {
/// - The name of the step doesn't change
/// - The total number of steps doesn't change
pub struct AtomicSubStep<Name: NamedStep> {
name: Name,
unit_name: Name,
current: Arc<AtomicU32>,
total: u32,
}
@ -73,13 +73,13 @@ pub struct AtomicSubStep<Name: NamedStep> {
impl<Name: NamedStep> AtomicSubStep<Name> {
pub fn new(total: u32) -> (Arc<AtomicU32>, Self) {
let current = Arc::new(AtomicU32::new(0));
(current.clone(), Self { current, total, name: Name::default() })
(current.clone(), Self { current, total, unit_name: Name::default() })
}
}
impl<Name: NamedStep> Step for AtomicSubStep<Name> {
fn name(&self) -> Cow<'static, str> {
self.name.name().into()
self.unit_name.name().into()
}
fn current(&self) -> u32 {