Skip to content

Commit 9b1c9d7

Browse files
committed
Cargo formatting linter fixes
1 parent 3684483 commit 9b1c9d7

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

opentelemetry-sdk/src/trace/span.rs

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::time::SystemTime;
1616

1717
/// Single operation within a trace.
1818
#[derive(Debug)]
19-
pub struct Span<> {
19+
pub struct Span {
2020
span_context: SpanContext,
2121
data: Option<SpanData>,
2222
tracer: crate::trace::SdkTracer,
@@ -200,21 +200,19 @@ impl Span {
200200
fn ensure_ended_and_exported(&mut self, timestamp: Option<SystemTime>) {
201201
// skip if data has already been exported
202202
let mut data = match self.data.take() {
203-
Some(data) => {
204-
crate::trace::SpanData {
205-
span_context: self.span_context.clone(),
206-
parent_span_id: data.parent_span_id,
207-
span_kind: data.span_kind,
208-
name: data.name,
209-
start_time: data.start_time,
210-
end_time: data.end_time,
211-
attributes: data.attributes,
212-
dropped_attributes_count: data.dropped_attributes_count,
213-
events: data.events,
214-
links: data.links,
215-
status: data.status,
216-
instrumentation_scope: self.tracer.instrumentation_scope().clone(),
217-
}
203+
Some(data) => crate::trace::SpanData {
204+
span_context: self.span_context.clone(),
205+
parent_span_id: data.parent_span_id,
206+
span_kind: data.span_kind,
207+
name: data.name,
208+
start_time: data.start_time,
209+
end_time: data.end_time,
210+
attributes: data.attributes,
211+
dropped_attributes_count: data.dropped_attributes_count,
212+
events: data.events,
213+
links: data.links,
214+
status: data.status,
215+
instrumentation_scope: self.tracer.instrumentation_scope().clone(),
218216
},
219217
None => return,
220218
};
@@ -234,9 +232,7 @@ impl Span {
234232

235233
match provider.span_processors() {
236234
[] => {}
237-
[processor] => {
238-
processor.on_end(&mut data)
239-
}
235+
[processor] => processor.on_end(&mut data),
240236
processors => {
241237
for processor in processors {
242238
processor.on_end(&mut data);

opentelemetry-sdk/src/trace/span_processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ impl BatchSpanProcessor {
460460
E: SpanExporter + Send + Sync + 'static,
461461
{
462462
// Get upto `max_export_batch_size` amount of spans from the channel and push them to the span vec
463-
while let Ok(span) = spans_receiver.try_recv() {
463+
while let Ok(span) = spans_receiver.try_recv() {
464464
spans.push(span);
465465
if spans.len() == config.max_export_batch_size {
466466
break;

opentelemetry-sdk/src/trace/span_processor_with_async_runtime.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ impl<R: RuntimeChannel> SpanProcessor for BatchSpanProcessor<R> {
107107
return;
108108
}
109109

110-
let result = self.message_sender.try_send(BatchMessage::ExportSpan(span.clone()));
110+
let result = self
111+
.message_sender
112+
.try_send(BatchMessage::ExportSpan(span.clone()));
111113

112114
// If the queue is full, and we can't buffer a span
113115
if result.is_err() {

0 commit comments

Comments
 (0)