@@ -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) ;
0 commit comments