summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@ifm.com>2022-08-18 15:19:59 +0200
committerMatthias Beyer <matthias.beyer@ifm.com>2022-08-18 15:40:40 +0200
commit3b92e874d0a8b8bf6fbbb5203895632d08706f7e (patch)
tree65810a792281522d28193d28476c10883b2c2db8
parentf2a14038f7f395f8439b62cc70ad259ffa09a205 (diff)
Fix clippy: logged_command: Do not use format!() to append to String
This fixes clippy::format_push_string. The error returned from write!() is ignored in this case. Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
-rw-r--r--crates/common/logged_command/src/logged_command.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/common/logged_command/src/logged_command.rs b/crates/common/logged_command/src/logged_command.rs
index e276b495..8854a715 100644
--- a/crates/common/logged_command/src/logged_command.rs
+++ b/crates/common/logged_command/src/logged_command.rs
@@ -69,8 +69,9 @@ impl LoggedCommand {
}
pub fn arg(&mut self, arg: impl AsRef<OsStr>) -> &mut LoggedCommand {
+ use std::fmt::Write;
// The arguments are displayed as debug, to be properly quoted and distinguished from each other.
- self.command_line.push_str(&format!(" {:?}", arg.as_ref()));
+ let _ = write!(self.command_line, " {:?}", arg.as_ref());
self.command.arg(arg);
self
}