From c4f36779570cb238885151b192e925b43508cc21 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 19 Jan 2023 11:37:07 +0100 Subject: [PATCH] client: task log: use fstrings for shorter code Signed-off-by: Thomas Lamprecht --- pbs-client/src/task_log.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pbs-client/src/task_log.rs b/pbs-client/src/task_log.rs index 8fe8ac16..0bbb928d 100644 --- a/pbs-client/src/task_log.rs +++ b/pbs-client/src/task_log.rs @@ -74,13 +74,13 @@ pub async fn display_task_log( let n = item["n"].as_u64().unwrap(); let t = item["t"].as_str().unwrap(); 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] == ": " { let line = &t[27..]; - println!("{}", line); + println!("{line}"); } else { - println!("{}", t); + println!("{t}"); } start += 1; } @@ -92,11 +92,7 @@ pub async fn display_task_log( break; } } else if lines != limit { - bail!( - "got wrong number of lines from server ({} != {})", - lines, - limit - ); + bail!("got wrong number of lines from server ({lines} != {limit})"); } }