use regex::Regex;
pub fn generate_path_from_params(route_path: String, params: Vec<&str>) -> String {
let dynamic_regex = Regex::new(r"\{[^\{\}]*\}").unwrap();
let mut matches: Vec<String> = Vec::new();
let mut new_route_path = route_path;
for capture in dynamic_regex.captures_iter(&new_route_path) {
let dynamic_segement = capture[0].to_string();
matches.push(dynamic_segement);
}
for (index, str_match) in matches.iter().enumerate() {
let parsed_path = new_route_path.replacen(str_match, ¶ms[index], 1);
new_route_path = parsed_path;
}
new_route_path
}