]> git.proxmox.com Git - proxmox-backup.git/blob - pbs-tools/src/str.rs
add pbs-tools subcrate
[proxmox-backup.git] / pbs-tools / src / str.rs
1 //! String related utilities.
2
3 use std::borrow::Borrow;
4
5 pub fn join<S: Borrow<str>>(data: &[S], sep: char) -> String {
6 let mut list = String::new();
7
8 for item in data {
9 if !list.is_empty() {
10 list.push(sep);
11 }
12 list.push_str(item.borrow());
13 }
14
15 list
16 }
17