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:
parent
8735247f29
commit
5b17a02da4
@ -16,7 +16,7 @@ pub fn render_backup_file_list(files: &[String]) -> String {
|
|||||||
|
|
||||||
files.sort();
|
files.sort();
|
||||||
|
|
||||||
crate::str::join(&files, ' ')
|
files.join(" ")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render_epoch(value: &Value, _record: &Value) -> Result<String, Error> {
|
pub fn render_epoch(value: &Value, _record: &Value) -> Result<String, Error> {
|
||||||
|
@ -1,20 +1,5 @@
|
|||||||
//! String related utilities.
|
//! 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] {
|
pub fn strip_ascii_whitespace(line: &[u8]) -> &[u8] {
|
||||||
let line = match line.iter().position(|&b| !b.is_ascii_whitespace()) {
|
let line = match line.iter().position(|&b| !b.is_ascii_whitespace()) {
|
||||||
Some(n) => &line[n..],
|
Some(n) => &line[n..],
|
||||||
|
Loading…
Reference in New Issue
Block a user