Skip to content

Commit 5bf20af

Browse files
committed
fmt
1 parent cd813fc commit 5bf20af

File tree

6 files changed

+15
-30
lines changed

6 files changed

+15
-30
lines changed

opentelemetry-jaeger-propagator/src/propagator.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,7 @@ mod tests {
641641
}
642642
for (trace_id, span_id, flag, expected) in get_extract_data() {
643643
let mut map: HashMap<String, String> = HashMap::new();
644-
map.set(
645-
JAEGER_HEADER,
646-
format!("{trace_id}:{span_id}:0:{flag}"),
647-
);
644+
map.set(JAEGER_HEADER, format!("{trace_id}:{span_id}:0:{flag}"));
648645
let context = propagator.extract(&map);
649646
assert_eq!(context.span().span_context(), &expected);
650647
}

opentelemetry-otlp/tests/integration_test/src/metric_helpers.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,7 @@ pub fn fetch_latest_metrics_for_scope(scope_name: &str) -> Result<Value> {
160160
None
161161
})
162162
})
163-
.with_context(|| {
164-
format!(
165-
"No valid JSON line containing scope `{scope_name}` found."
166-
)
167-
})?;
163+
.with_context(|| format!("No valid JSON line containing scope `{scope_name}` found."))?;
168164

169165
Ok(json_line)
170166
}
@@ -183,9 +179,8 @@ pub fn validate_metrics_against_results(scope_name: &str) -> Result<()> {
183179

184180
// Read the expected metrics from the results file
185181
let expected_metrics = {
186-
let file = File::open(&results_file_path).context(format!(
187-
"Failed to open results file: {results_file_path}"
188-
))?;
182+
let file = File::open(&results_file_path)
183+
.context(format!("Failed to open results file: {results_file_path}"))?;
189184
read_metrics_from_json(file)
190185
}?;
191186

opentelemetry-sdk/benches/metric.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,9 @@ fn histograms(c: &mut Criterion) {
312312
))
313313
}
314314
let value: u64 = rng.random_range(0..MAX_BOUND).try_into().unwrap();
315-
group.bench_function(
316-
format!("Record{attr_size}Attrs{bound_size}bounds"),
317-
|b| b.iter(|| hist.record(value, &attributes)),
318-
);
315+
group.bench_function(format!("Record{attr_size}Attrs{bound_size}bounds"), |b| {
316+
b.iter(|| hist.record(value, &attributes))
317+
});
319318
}
320319
}
321320
group.bench_function("CollectOne", |b| benchmark_collect_histogram(b, 1));

opentelemetry-sdk/src/metrics/internal/exponential_histogram.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,10 +1635,7 @@ mod tests {
16351635
assert_eq!(a.sum, b.sum, "{test_name}: {message} sum");
16361636

16371637
assert_eq!(a.scale, b.scale, "{test_name}: {message} scale");
1638-
assert_eq!(
1639-
a.zero_count, b.zero_count,
1640-
"{test_name}: {message} zeros"
1641-
);
1638+
assert_eq!(a.zero_count, b.zero_count, "{test_name}: {message} zeros");
16421639

16431640
assert_eq!(
16441641
a.positive_bucket, b.positive_bucket,

opentelemetry-sdk/src/trace/in_memory_exporter.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ impl SpanExporter for InMemorySpanExporter {
135135
.spans
136136
.lock()
137137
.map(|mut spans_guard| spans_guard.append(&mut batch.clone()))
138-
.map_err(|err| {
139-
OTelSdkError::InternalFailure(format!("Failed to lock spans: {err:?}"))
140-
});
138+
.map_err(|err| OTelSdkError::InternalFailure(format!("Failed to lock spans: {err:?}")));
141139
result
142140
}
143141

opentelemetry-zipkin/src/exporter/uploader.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ impl JsonV2Client {
4545
.uri(self.collector_endpoint.clone())
4646
.header(CONTENT_TYPE, "application/json")
4747
.body(body.into())
48-
.map_err(|e| {
49-
OTelSdkError::InternalFailure(format!("Failed to create request: {e}"))
50-
})?;
48+
.map_err(|e| OTelSdkError::InternalFailure(format!("Failed to create request: {e}")))?;
5149

52-
let response =
53-
self.client.send_bytes(req).await.map_err(|e| {
54-
OTelSdkError::InternalFailure(format!("HTTP request failed: {e}"))
55-
})?;
50+
let response = self
51+
.client
52+
.send_bytes(req)
53+
.await
54+
.map_err(|e| OTelSdkError::InternalFailure(format!("HTTP request failed: {e}")))?;
5655

5756
response
5857
.error_for_status()

0 commit comments

Comments
 (0)