src/tools.rs: add simply string join

This commit is contained in:
Dietmar Maurer 2019-03-02 16:12:34 +01:00
parent 812c6f8716
commit af53186e6a
1 changed files with 12 additions and 0 deletions

View File

@ -475,3 +475,15 @@ pub fn extract_auth_cookie(cookie: &str, cookie_name: &str) -> Option<String> {
None None
} }
pub fn join(data: &Vec<String>, sep: char) -> String {
let mut list = String::new();
for item in data {
if list.len() != 0 { list.push(sep); }
list.push_str(item);
}
list
}