Skip to main content

real_or_none

Function real_or_none 

Source
pub fn real_or_none(value: &str) -> Option<&str>
Expand description

Treat the harness “unknown” placeholder and empty/whitespace strings as absent so renderers don’t surface them as literal text. Mirrors the discipline in snapshot::clean_attribution_value — the harness writes “unknown” when it can’t identify provider/model from argv/env, and rendering that literally as anthropic/unknown is worse than just showing the meaningful side.