ggsci 0.6.1

Scientific and sci-fi color palettes from ggsci for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub(crate) fn key_matches(canonical: &str, requested: &str) -> bool {
    normalize_key(canonical) == normalize_key(requested)
}

pub(crate) fn normalize_key(input: &str) -> String {
    input
        .trim()
        .chars()
        .map(|ch| match ch {
            '_' | '-' => ' ',
            ch if ch.is_whitespace() => ' ',
            ch => ch.to_ascii_lowercase(),
        })
        .collect()
}