From 3b82f3eea5d3db2d7edba3d66a62656893f9f315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 19 Jan 2021 10:54:37 +0100 Subject: [PATCH] clippy: avoid useless format! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- src/api2/tape/drive.rs | 2 +- src/api2/tape/restore.rs | 2 +- src/bin/proxmox-backup-proxy.rs | 14 +++++++------- src/tape/drive/mod.rs | 2 +- src/tape/pool_writer.rs | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/api2/tape/drive.rs b/src/api2/tape/drive.rs index ba80f488..4571d9e2 100644 --- a/src/api2/tape/drive.rs +++ b/src/api2/tape/drive.rs @@ -730,7 +730,7 @@ pub fn update_inventory( let label_text_list = changer.online_media_label_texts()?; if label_text_list.is_empty() { - worker.log(format!("changer device does not list any media labels")); + worker.log("changer device does not list any media labels".to_string()); } let state_path = Path::new(TAPE_STATUS_DIR); diff --git a/src/api2/tape/restore.rs b/src/api2/tape/restore.rs index 6854221d..e97ae4a4 100644 --- a/src/api2/tape/restore.rs +++ b/src/api2/tape/restore.rs @@ -389,7 +389,7 @@ fn restore_chunk_archive<'a>( // check if this is an aborted stream without end marker if let Ok(false) = reader.has_end_marker() { - worker.log(format!("missing stream end marker")); + worker.log("missing stream end marker".to_string()); return Ok(None); } diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs index 53bd526b..bb2be243 100644 --- a/src/bin/proxmox-backup-proxy.rs +++ b/src/bin/proxmox-backup-proxy.rs @@ -581,16 +581,16 @@ async fn schedule_task_log_rotate() { false, move |worker| { job.start(&worker.upid().to_string())?; - worker.log(format!("starting task log rotation")); + worker.log("starting task log rotation".to_string()); let result = try_block!({ let max_size = 512 * 1024 - 1; // an entry has ~ 100b, so > 5000 entries/file let max_files = 20; // times twenty files gives > 100000 task entries let has_rotated = rotate_task_log_archive(max_size, true, Some(max_files))?; if has_rotated { - worker.log(format!("task log archive was rotated")); + worker.log("task log archive was rotated".to_string()); } else { - worker.log(format!("task log archive was not rotated")); + worker.log("task log archive was not rotated".to_string()); } let max_size = 32 * 1024 * 1024 - 1; @@ -601,18 +601,18 @@ async fn schedule_task_log_rotate() { if logrotate.rotate(max_size, None, Some(max_files))? { println!("rotated access log, telling daemons to re-open log file"); proxmox_backup::tools::runtime::block_on(command_reopen_logfiles())?; - worker.log(format!("API access log was rotated")); + worker.log("API access log was rotated".to_string()); } else { - worker.log(format!("API access log was not rotated")); + worker.log("API access log was not rotated".to_string()); } let mut logrotate = LogRotate::new(buildcfg::API_AUTH_LOG_FN, true) .ok_or_else(|| format_err!("could not get API auth log file names"))?; if logrotate.rotate(max_size, None, Some(max_files))? { - worker.log(format!("API authentication log was rotated")); + worker.log("API authentication log was rotated".to_string()); } else { - worker.log(format!("API authentication log was not rotated")); + worker.log("API authentication log was not rotated".to_string()); } Ok(()) diff --git a/src/tape/drive/mod.rs b/src/tape/drive/mod.rs index a74b5084..6f6b6f75 100644 --- a/src/tape/drive/mod.rs +++ b/src/tape/drive/mod.rs @@ -391,7 +391,7 @@ pub fn request_and_load_media( } Ok((None, _)) => { if last_media_uuid.is_some() { - worker.log(format!("found empty media without label (please label all tapes first)")); + worker.log("found empty media without label (please label all tapes first)".to_string()); last_media_uuid = None; } } diff --git a/src/tape/pool_writer.rs b/src/tape/pool_writer.rs index 5cb04eb9..4486d644 100644 --- a/src/tape/pool_writer.rs +++ b/src/tape/pool_writer.rs @@ -426,7 +426,7 @@ fn write_chunk_archive<'a>( } if writer.bytes_written() > max_size { - worker.log(format!("Chunk Archive max size reached, closing archive")); + worker.log("Chunk Archive max size reached, closing archive".to_string()); break; } } @@ -472,7 +472,7 @@ fn update_media_set_label( match old_set { None => { - worker.log(format!("wrinting new media set label")); + worker.log("wrinting new media set label".to_string()); drive.write_media_set_label(new_set, key_config.as_ref())?; media_catalog = MediaCatalog::overwrite(status_path, media_id, false)?; }