mla-titlecase 0.2.0

MLA title casing library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
const PROTECTED: &[(&str, &str)] = &[
    ("ebay", "eBay"),
    ("github", "GitHub"),
    ("iphone", "iPhone"),
    ("ipad", "iPad"),
    ("macos", "macOS"),
    ("rust", "Rust"),
];

pub(crate) fn canonical(word: &str) -> Option<&'static str> {
    PROTECTED.iter().find(|(key, _)| *key == word).map(|(_, value)| *value)
}