Skip to main content

parse_direction_hint

Function parse_direction_hint 

Source
pub fn parse_direction_hint(
    raw: &str,
    slug: &str,
    warn: &mut dyn FnMut(String),
) -> Hints
Expand description

Split raw into its direction text, source hint and attribute hints.

Segments after the first are classified independently and order-free: a .mp3/.wav is the source (first wins), a key=value whose key is in HINT_ATTRS is an override, anything else is re-joined onto the text so a writer’s prose note survives verbatim.

warn receives the message Python logs for a malformed value; one bad hint must never abort a whole script parse.