drop str::join helper

the standard join method can do this now

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-09-30 11:35:12 +02:00
parent 8735247f29
commit 5b17a02da4
2 changed files with 1 additions and 16 deletions

View 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> {

View 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..],