trello-to-deck/src/template.rs

11 lines
271 B
Rust
Raw Normal View History

//
use std::collections::HashMap;
pub(crate) fn expand(template: &str, params: HashMap<&str, &str>) -> String {
let mut result = template.to_string();
for (key, value) in params {
result = result.replace(&format!("{{{key}}}"), value);
}
result
}