move pbs-tools/src/str.rs to pbs-client/src/pxar/create.rs

Code is only used there.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer
2021-11-25 10:43:22 +01:00
parent 8a8a1850d0
commit 92ef0b56d8
3 changed files with 11 additions and 14 deletions

View File

@ -7,7 +7,6 @@ pub mod lru_cache;
pub mod nom;
pub mod percent_encoding;
pub mod sha;
pub mod str;
pub mod sync;
pub mod ticket;

View File

@ -1,12 +0,0 @@
//! String related utilities.
pub fn strip_ascii_whitespace(line: &[u8]) -> &[u8] {
let line = match line.iter().position(|&b| !b.is_ascii_whitespace()) {
Some(n) => &line[n..],
None => return &[],
};
match line.iter().rev().position(|&b| !b.is_ascii_whitespace()) {
Some(n) => &line[..(line.len() - n)],
None => &[],
}
}