mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-09 15:15:28 +00:00
client: task log: use fstrings for shorter code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
22fc132a73
commit
c4f3677957
@ -74,13 +74,13 @@ pub async 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 {
|
if n != start {
|
||||||
bail!("got wrong line number in response data ({} != {}", n, start);
|
bail!("got wrong line number in response data ({n} != {start}");
|
||||||
}
|
}
|
||||||
if strip_date && t.len() > 27 && &t[25..27] == ": " {
|
if strip_date && t.len() > 27 && &t[25..27] == ": " {
|
||||||
let line = &t[27..];
|
let line = &t[27..];
|
||||||
println!("{}", line);
|
println!("{line}");
|
||||||
} else {
|
} else {
|
||||||
println!("{}", t);
|
println!("{t}");
|
||||||
}
|
}
|
||||||
start += 1;
|
start += 1;
|
||||||
}
|
}
|
||||||
@ -92,11 +92,7 @@ pub async fn display_task_log(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if lines != limit {
|
} else if lines != limit {
|
||||||
bail!(
|
bail!("got wrong number of lines from server ({lines} != {limit})");
|
||||||
"got wrong number of lines from server ({} != {})",
|
|
||||||
lines,
|
|
||||||
limit
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user