Skip to content

Commit

Permalink
fix: Clippy warnings
Browse files Browse the repository at this point in the history
- Remove all clippy warnings using Rust release 1.61.
  • Loading branch information
uggla committed Jun 25, 2022
1 parent 6bc55c5 commit 2df4dcf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/exporters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,7 @@ impl MetricGenerator {
attributes.insert("exe".to_string(), exe.clone());

if let Some(cmdline_str) = cmdline {
attributes.insert("cmdline".to_string(), cmdline_str.replace('\"', "\\\""));

attributes.insert("cmdline".to_string(), cmdline_str.replace('"', "\\\""));
if self.qemu {
if let Some(vmname) = utils::filter_qemu_cmdline(&cmdline_str) {
attributes.insert("vmname".to_string(), vmname);
Expand Down
2 changes: 1 addition & 1 deletion src/exporters/prometheus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ fn format_metric(key: &str, value: &str, labels: Option<&HashMap<String, String>
if let Some(labels) = labels {
result.push('{');
for (k, v) in labels.iter() {
result.push_str(&format!("{}=\"{}\",", k, v.replace('\"', "_")));
result.push_str(&format!("{}=\"{}\",", k, v.replace('"', "_")));
}
result.remove(result.len() - 1);
result.push('}');
Expand Down
3 changes: 1 addition & 2 deletions src/exporters/riemann.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ impl Exporter for RiemannExporter {
attributes.insert("exe".to_string(), exe.clone());

if let Some(cmdline_str) = cmdline {
attributes.insert("cmdline".to_string(), cmdline_str.replace('\"', "\\\""));

attributes.insert("cmdline".to_string(), cmdline_str.replace('"', "\\\""));
if parameters.is_present("qemu") {
if let Some(vmname) = utils::filter_qemu_cmdline(&cmdline_str) {
attributes.insert("vmname".to_string(), vmname);
Expand Down
2 changes: 1 addition & 1 deletion src/exporters/warpten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ impl Warp10Exporter {
}
plabels.push(warp10::Label::new(
"cmdline",
&cmdline_str.replace('\"', "\\\""),
&cmdline_str.replace('"', "\\\""),
));
}
let metric_name = format!(
Expand Down

0 comments on commit 2df4dcf

Please sign in to comment.