regorus 0.10.1

A fast, lightweight Rego (OPA policy language) interpreter
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

//! Small helper functions used by the denormalizer.

use crate::Rc;

use super::super::obj_map::ObjMap;

/// Find a key in an ObjMap using case-insensitive comparison.
pub fn find_key_ci(obj: &ObjMap, key: &str) -> Option<Rc<str>> {
    obj.keys().find(|k| k.eq_ignore_ascii_case(key)).cloned()
}