From the docs it's not clear which values this string can have!
It would be a nicer & more idiomatic & stable API if the set of possible languages was represented as an enum.
Then we could easily match on that, to map it to syntax highlighters, markdown codeblock-language-indicator-abbreviations etc.
And it would also be more ergonomic if Detection had separate fields for language and detection method. E.g.:
pub struct Detection {
pub language: Language, // The new enum
pub method: DetectionMethod, // Separate enum
}
From the docs it's not clear which values this string can have! It would be a nicer & more idiomatic & stable API if the set of possible languages was represented as an enum. Then we could easily match on that, to map it to syntax highlighters, markdown codeblock-language-indicator-abbreviations etc.
And it would also be more ergonomic if
Detection
had separate fields for language and detection method. E.g.: