#![allow(dead_code)]
pub fn event_type_base_name(event_type: &str) -> &str {
event_type.rsplit("::").next().unwrap_or(event_type)
}
pub fn event_type_program(event_type: &str) -> Option<&str> {
event_type.rsplit_once("::").map(|(prefix, _)| prefix)
}
pub fn strip_event_type_suffix(event_type: &str) -> &str {
let base = event_type_base_name(event_type);
base.strip_suffix("IxState")
.or_else(|| base.strip_suffix("State"))
.unwrap_or(base)
}
pub fn scoped_event_type(program_name: &str, type_name: &str, is_instruction: bool) -> String {
let suffix = if is_instruction { "IxState" } else { "State" };
format!("{}::{}{}", program_name, type_name, suffix)
}