feignhttp 0.5.2

Declarative HTTP client for rust
Documentation
1
2
3
4
5
6
7
8
9
use std::collections::HashMap;

pub fn replace(placeholder: &str, map: &HashMap<&str, String>) -> String {
    let mut placeholder = placeholder.to_string();
    for (k, v) in map {
        placeholder = placeholder.replace(format!("{{{}}}", k).as_str(), &v);
    }
    placeholder
}