refactor: derive Ruby action namespaces from Rust catalog
This commit is contained in:
@@ -476,6 +476,15 @@ const CORE_ACTIONS: &[(&str, Action, &[Mode])] = &[
|
||||
),
|
||||
];
|
||||
|
||||
/// Serializes the authoritative action names without copying the catalog.
|
||||
pub(crate) struct CoreActionCatalog;
|
||||
|
||||
impl Serialize for CoreActionCatalog {
|
||||
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
||||
serializer.collect_seq(CORE_ACTIONS.iter().map(|(name, _, _)| *name))
|
||||
}
|
||||
}
|
||||
|
||||
impl Action {
|
||||
fn named(mode: Mode, name: &str) -> Option<Self> {
|
||||
CORE_ACTIONS
|
||||
|
||||
Reference in New Issue
Block a user