Skip to main content

format_by_name

Function format_by_name 

Source
pub fn format_by_name(name: &str) -> Result<FormatId>
Expand description

Resolves a --format name against the registry. Shared by main’s verbs and stuffr bench.

FormatId holds a &'static str so the registry can be built from constants without allocation, but a flag value arrives at runtime as a String. Rather than leak it to reach 'static, look it up: the registry already holds the 'static id, and an unknown name gets a real error naming what this build does have.