Skip to main content

normalize

Function normalize 

Source
pub fn normalize(raw: &str) -> &str
Expand description

Normalise a raw dev-id to a registry component.

The elm bridge macro fills Facet::component with module_path!(), which expands at the CALL site — so a pane in facett-geomap reports facett_geomap (or facett_geomap::inner) with no per-pane code at all. This maps that to the registry’s vocabulary: take the crate segment, drop the facett_ prefix, and spell _ as -. facett_geomap::xgeomap, facett_map3dmap3d.

A hand-written component() returning a bare "geomap" passes through unchanged, so both spellings are legal and neither needs to know about the other.