]> git.proxmox.com Git - proxmox-backup.git/commitdiff
drop str::join helper
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 30 Sep 2021 09:35:12 +0000 (11:35 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 30 Sep 2021 10:43:33 +0000 (12:43 +0200)
the standard join method can do this now

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
pbs-tools/src/format.rs
pbs-tools/src/str.rs

index a69f5a1799a6635973c6fb2a1e3b2605346a38c1..b7b3544d92b2c0110f4d5569f41d7c262bc70dd8 100644 (file)
@@ -16,7 +16,7 @@ pub fn render_backup_file_list(files: &[String]) -> String {
 
     files.sort();
 
-    crate::str::join(&files, ' ')
+    files.join(" ")
 }
 
 pub fn render_epoch(value: &Value, _record: &Value) -> Result<String, Error> {
index 387fe5fe18e34f17db6102c74536ed246c6ba08d..5bea24150e7ce05758152f387bef62bb5cb8bece 100644 (file)
@@ -1,20 +1,5 @@
 //! String related utilities.
 
-use std::borrow::Borrow;
-
-pub fn join<S: Borrow<str>>(data: &[S], sep: char) -> String {
-    let mut list = String::new();
-
-    for item in data {
-        if !list.is_empty() {
-            list.push(sep);
-        }
-        list.push_str(item.borrow());
-    }
-
-    list
-}
-
 pub fn strip_ascii_whitespace(line: &[u8]) -> &[u8] {
     let line = match line.iter().position(|&b| !b.is_ascii_whitespace()) {
         Some(n) => &line[n..],