rusoto_codegen 0.8.0

Code generation library for Rusoto.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::collections::BTreeMap;

/// Returns the first value from a `String`-keyed `BTreeMap` matching the
/// provided case-insensitive `String` key.
#[inline]
pub fn case_insensitive_btreemap_get<'a, V>(map: &'a BTreeMap<String, V>,
                                            key: &str)
                                            -> Option<&'a V> {
    map.iter()
        .filter(|&(k, _)| k.to_lowercase() == key.to_lowercase())
        .map(|(_, v)| v)
        .next()
}