oxidy 0.5.0

Fast & Minimum Web Framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub(crate) async fn set_vec(
    obj: &[(String, String)],
    key: String,
    value: String,
) -> Vec<(String, String)> {
    let mut obj: Vec<(String, String)> = obj
        .iter()
        .cloned()
        .filter(|(k, _)| k.to_owned().to_lowercase() != key.to_lowercase())
        .collect();

    obj.push((key, value));

    obj
}