src/bin/proxmox-backup-client.r - display_task_log: use string range instead of as_bytes

This commit is contained in:
Dietmar Maurer 2019-12-08 10:25:26 +01:00
parent b73ff941f6
commit ec137a99c6
1 changed files with 1 additions and 2 deletions

View File

@ -1149,8 +1149,7 @@ fn display_task_log(
let n = item["n"].as_u64().unwrap(); let n = item["n"].as_u64().unwrap();
let t = item["t"].as_str().unwrap(); let t = item["t"].as_str().unwrap();
if n != start { bail!("got wrong line number in response data ({} != {}", n, start); } if n != start { bail!("got wrong line number in response data ({} != {}", n, start); }
let b = t.as_bytes(); if strip_date && t.len() > 27 && &t[25..27] == ": " {
if strip_date && b.len() > 27 && b[25] == b':' && b[26] == b' '{
let line = &t[27..]; let line = &t[27..];
println!("{}", line); println!("{}", line);
} else { } else {