Skip to content

Commit 6e9fc38

Browse files
authored
[chore] Fix clippy warnings (#1216)
1 parent 0262f08 commit 6e9fc38

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

datadog-crashtracker/benches/receiver_bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn add_config(report: &mut String) {
5151
.expect("Failed to create crashtracker configuration");
5252
let config_str =
5353
serde_json::to_string(&config).expect("Failed to serialize crashtracker configuration");
54-
writeln!(report, "{}", config_str).expect("Failed to write crashtracker configuration");
54+
writeln!(report, "{config_str}").expect("Failed to write crashtracker configuration");
5555
writeln!(report, "{DD_CRASHTRACK_END_CONFIG}")
5656
.expect("Failed to write DD_CRASHTRACK_END_CONFIG");
5757
}

datadog-crashtracker/src/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ impl SharedLibrary {
3232
let cstr = CString::new(symbol).map_err(|e| e.to_string())?;
3333
let sym = unsafe { libc::dlsym(self.handle, cstr.as_ptr()) };
3434
if sym.is_null() {
35-
Err(format!("Failed to find symbol: {}", symbol))
35+
Err(format!("Failed to find symbol: {symbol}"))
3636
} else {
37-
Ok(format!("{:p}", sym))
37+
Ok(format!("{sym:p}"))
3838
}
3939
}
4040
}

datadog-crashtracker/src/crash_info/telemetry.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ impl TelemetryCrashUploader {
153153
);
154154

155155
if let Some(env) = &metadata.application.env {
156-
tags.push_str(&format!(",env:{}", env));
156+
tags.push_str(&format!(",env:{env}"));
157157
}
158158
if let Some(runtime_name) = &metadata.application.runtime_name {
159-
tags.push_str(&format!(",runtime_name:{}", runtime_name));
159+
tags.push_str(&format!(",runtime_name:{runtime_name}"));
160160
}
161161
if let Some(runtime_version) = &metadata.application.runtime_version {
162-
tags.push_str(&format!(",runtime_version:{}", runtime_version));
162+
tags.push_str(&format!(",runtime_version:{runtime_version}"));
163163
}
164164

165165
// Add signal information to tags
@@ -457,7 +457,7 @@ mod tests {
457457

458458
// Customer application and runtime information tags
459459
let tags = log_entry["tags"].as_str().unwrap();
460-
assert!(tags.contains(&format!("uuid:{}", crash_uuid)));
460+
assert!(tags.contains(&format!("uuid:{crash_uuid}")));
461461
assert!(tags.contains("is_crash_ping:true"));
462462
assert!(tags.contains("service:foo"));
463463
assert!(tags.contains("language_name:native"));
@@ -520,7 +520,7 @@ mod tests {
520520

521521
// Customer application and runtime information tags
522522
let tags = log_entry["tags"].as_str().unwrap();
523-
assert!(tags.contains(&format!("uuid:{}", crash_uuid)));
523+
assert!(tags.contains(&format!("uuid:{crash_uuid}")));
524524
assert!(tags.contains("is_crash_ping:true"));
525525
assert!(tags.contains("service:foo"));
526526
assert!(tags.contains("language_name:native"));

tools/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ pub mod headers {
168168
assert_eq!(
169169
matches.len(),
170170
expected.len(),
171-
"Expected:\n{:#?}\nActual:\n{:#?}",
172-
expected,
173-
matches
171+
"Expected:\n{expected:#?}\nActual:\n{matches:#?}",
174172
);
175173
for (i, m) in matches.iter().enumerate() {
176174
assert_eq!(m.str, expected[i]);

0 commit comments

Comments
 (0)