Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy #178

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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