Skip to content

Commit b654b77

Browse files
hooliohgleocadie
authored andcommitted
Fix lint.
1 parent da17eba commit b654b77

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use criterion::{criterion_main, criterion_group, Criterion};
4+
use criterion::{criterion_group, criterion_main, Criterion};
55

6-
#[cfg(feature = "benchmarking")]
6+
#[cfg(all(unix, feature = "benchmarking"))]
77
mod receiver_bench;
88

9-
#[cfg(feature = "benchmarking")]
10-
fn active_benches(c: &mut Criterion) {
9+
#[cfg(all(unix, feature = "benchmarking"))]
10+
fn active_benches(_: &mut Criterion) {
1111
receiver_bench::benches();
1212
}
1313

14-
#[cfg(not(feature = "benchmarking"))]
14+
#[cfg(any(windows, not(feature = "benchmarking")))]
1515
fn active_benches(_: &mut Criterion) {
16-
println!(
17-
"Benchmarks are disabled. Enable with `--features datadog-crashtracker/benchmarking`."
18-
);
16+
println!("Benchmarks are disabled.");
1917
}
2018
criterion_group!(benches, active_benches);
2119
criterion_main!(benches);

datadog-crashtracker/benches/receiver_bench.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ use datadog_crashtracker::benchmark::receiver_entry_point;
66
use std::time::Duration;
77
use tokio::io::BufReader;
88

9-
109
fn create_dummy_crash_report() -> String {
1110
r#"DD_CRASHTRACK_BEGIN_STACKTRACE
1211
{ "ip": "0x42", "module_address": "0x21", "sp": "0x11", "symbol_address": "0x73" }
1312
DD_CRASHTRACK_END_STACKTRACE
14-
DD_CRASHTRACK_DONE"#.to_string()
13+
DD_CRASHTRACK_DONE"#
14+
.to_string()
1515
}
1616

1717
async fn bench_receiver_entry_point_from_str(data: &str) {
1818
let cursor = std::io::Cursor::new(data.as_bytes());
1919
let reader = BufReader::new(cursor);
2020
let timeout = Duration::from_millis(5000);
21-
21+
2222
let _ = receiver_entry_point(timeout, reader).await;
2323
}
2424

2525
pub fn receiver_entry_point_benchmarks(c: &mut Criterion) {
2626
let mut group = c.benchmark_group("receiver_entry_point");
27-
27+
2828
let report = create_dummy_crash_report();
2929
group.throughput(Throughput::Bytes(report.len() as u64));
3030
group.bench_with_input(

datadog-crashtracker/src/receiver/benchmark.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// Copyright 2023-Present Datadog, Inc. https://www.datadoghq.com/
3+
#![cfg(unix)]
34

45
use std::time::Duration;
5-
use tokio::{
6-
io::{AsyncBufReadExt},
7-
};
6+
use tokio::io::AsyncBufReadExt;
87

98
pub async fn receiver_entry_point(
109
timeout: Duration,

0 commit comments

Comments
 (0)