misc: clippy: add manual_string_new

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
Philipp Schuster
2025-11-18 12:27:30 +01:00
committed by Rob Bradford
parent b4c62bf159
commit fed010fcd1
5 changed files with 15 additions and 14 deletions

View File

@@ -48,7 +48,7 @@ pub struct MetricsReport {
impl Default for MetricsReport {
fn default() -> Self {
let mut git_human_readable = "".to_string();
let mut git_human_readable = String::new();
if let Ok(git_out) = Command::new("git").args(["describe", "--dirty"]).output() {
if git_out.status.success() {
git_human_readable = String::from_utf8(git_out.stdout)
@@ -63,7 +63,7 @@ impl Default for MetricsReport {
}
}
let mut git_revision = "".to_string();
let mut git_revision = String::new();
if let Ok(git_out) = Command::new("git").args(["rev-parse", "HEAD"]).output() {
if git_out.status.success() {
git_revision = String::from_utf8(git_out.stdout)
@@ -78,7 +78,7 @@ impl Default for MetricsReport {
}
}
let mut git_commit_date = "".to_string();
let mut git_commit_date = String::new();
if let Ok(git_out) = Command::new("git")
.args(["show", "-s", "--format=%cd"])
.output()