src/tools.rs: add simply string join
This commit is contained in:
parent
812c6f8716
commit
af53186e6a
12
src/tools.rs
12
src/tools.rs
|
@ -475,3 +475,15 @@ pub fn extract_auth_cookie(cookie: &str, cookie_name: &str) -> Option<String> {
|
|||
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue