diff --git a/pagetop/src/core/action.rs b/pagetop/src/core/action.rs index 455e2176..9d97640e 100644 --- a/pagetop/src/core/action.rs +++ b/pagetop/src/core/action.rs @@ -1,9 +1,9 @@ mod definition; pub use definition::{action_ref, ActionTrait, AnyAction}; -mod bundle; -pub use bundle::Action; -use bundle::ActionsBundle; +mod list; +pub use list::Action; +use list::ActionsList; mod all; pub(crate) use all::add_action; diff --git a/pagetop/src/core/action/all.rs b/pagetop/src/core/action/all.rs index 4879dd15..9737d98c 100644 --- a/pagetop/src/core/action/all.rs +++ b/pagetop/src/core/action/all.rs @@ -1,11 +1,11 @@ -use crate::core::action::{Action, ActionsBundle}; +use crate::core::action::{Action, ActionsList}; use crate::{Handle, LazyStatic}; use std::collections::HashMap; use std::sync::RwLock; // Registered actions. -static ACTIONS: LazyStatic>> = +static ACTIONS: LazyStatic>> = LazyStatic::new(|| RwLock::new(HashMap::new())); pub fn add_action(action: Action) { @@ -14,7 +14,7 @@ pub fn add_action(action: Action) { if let Some(bundle) = actions.get_mut(&action_handle) { bundle.add(action); } else { - actions.insert(action_handle, ActionsBundle::new_with(action)); + actions.insert(action_handle, ActionsList::new_with(action)); } } diff --git a/pagetop/src/core/action/bundle.rs b/pagetop/src/core/action/list.rs similarity index 81% rename from pagetop/src/core/action/bundle.rs rename to pagetop/src/core/action/list.rs index 2d4ea49d..699c76b4 100644 --- a/pagetop/src/core/action/bundle.rs +++ b/pagetop/src/core/action/list.rs @@ -11,15 +11,15 @@ macro_rules! action { }}; } -pub struct ActionsBundle(Arc>>); +pub struct ActionsList(Arc>>); -impl ActionsBundle { +impl ActionsList { pub fn new() -> Self { - ActionsBundle(Arc::new(RwLock::new(Vec::new()))) + ActionsList(Arc::new(RwLock::new(Vec::new()))) } pub fn new_with(action: Action) -> Self { - let mut bundle = ActionsBundle::new(); + let mut bundle = ActionsList::new(); bundle.add(action); bundle }