@@ -91,7 +91,7 @@ pub trait SpanProcessor: Send + Sync + std::fmt::Debug {
91
91
fn force_flush ( & self ) -> TraceResult < ( ) > ;
92
92
/// Shuts down the processor. Called when SDK is shut down. This is an
93
93
/// opportunity for processors to do any cleanup required.
94
- fn shutdown ( & mut self ) -> TraceResult < ( ) > ;
94
+ fn shutdown ( & self ) -> TraceResult < ( ) > ;
95
95
}
96
96
97
97
/// A [SpanProcessor] that passes finished spans to the configured
@@ -137,7 +137,7 @@ impl SpanProcessor for SimpleSpanProcessor {
137
137
Ok ( ( ) )
138
138
}
139
139
140
- fn shutdown ( & mut self ) -> TraceResult < ( ) > {
140
+ fn shutdown ( & self ) -> TraceResult < ( ) > {
141
141
if let Ok ( mut exporter) = self . exporter . lock ( ) {
142
142
exporter. shutdown ( ) ;
143
143
Ok ( ( ) )
@@ -249,7 +249,7 @@ impl<R: RuntimeChannel> SpanProcessor for BatchSpanProcessor<R> {
249
249
. and_then ( |identity| identity)
250
250
}
251
251
252
- fn shutdown ( & mut self ) -> TraceResult < ( ) > {
252
+ fn shutdown ( & self ) -> TraceResult < ( ) > {
253
253
let ( res_sender, res_receiver) = oneshot:: channel ( ) ;
254
254
self . message_sender
255
255
. try_send ( BatchMessage :: Shutdown ( res_sender) )
@@ -687,7 +687,7 @@ mod tests {
687
687
#[ test]
688
688
fn simple_span_processor_on_end_calls_export ( ) {
689
689
let exporter = InMemorySpanExporterBuilder :: new ( ) . build ( ) ;
690
- let mut processor = SimpleSpanProcessor :: new ( Box :: new ( exporter. clone ( ) ) ) ;
690
+ let processor = SimpleSpanProcessor :: new ( Box :: new ( exporter. clone ( ) ) ) ;
691
691
let span_data = new_test_export_span_data ( ) ;
692
692
processor. on_end ( span_data. clone ( ) ) ;
693
693
assert_eq ! ( exporter. get_finished_spans( ) . unwrap( ) [ 0 ] , span_data) ;
@@ -720,7 +720,7 @@ mod tests {
720
720
#[ test]
721
721
fn simple_span_processor_shutdown_calls_shutdown ( ) {
722
722
let exporter = InMemorySpanExporterBuilder :: new ( ) . build ( ) ;
723
- let mut processor = SimpleSpanProcessor :: new ( Box :: new ( exporter. clone ( ) ) ) ;
723
+ let processor = SimpleSpanProcessor :: new ( Box :: new ( exporter. clone ( ) ) ) ;
724
724
let span_data = new_test_export_span_data ( ) ;
725
725
processor. on_end ( span_data. clone ( ) ) ;
726
726
assert ! ( !exporter. get_finished_spans( ) . unwrap( ) . is_empty( ) ) ;
@@ -876,7 +876,7 @@ mod tests {
876
876
scheduled_delay : Duration :: from_secs ( 60 * 60 * 24 ) , // set the tick to 24 hours so we know the span must be exported via force_flush
877
877
..Default :: default ( )
878
878
} ;
879
- let mut processor =
879
+ let processor =
880
880
BatchSpanProcessor :: new ( Box :: new ( exporter) , config, runtime:: TokioCurrentThread ) ;
881
881
let handle = tokio:: spawn ( async move {
882
882
loop {
@@ -976,7 +976,7 @@ mod tests {
976
976
delay_for : Duration :: from_millis ( if !time_out { 5 } else { 60 } ) ,
977
977
delay_fn : async_std:: task:: sleep,
978
978
} ;
979
- let mut processor = BatchSpanProcessor :: new ( Box :: new ( exporter) , config, runtime:: AsyncStd ) ;
979
+ let processor = BatchSpanProcessor :: new ( Box :: new ( exporter) , config, runtime:: AsyncStd ) ;
980
980
processor. on_end ( new_test_export_span_data ( ) ) ;
981
981
let flush_res = processor. force_flush ( ) ;
982
982
if time_out {
@@ -1000,7 +1000,7 @@ mod tests {
1000
1000
delay_for : Duration :: from_millis ( if !time_out { 5 } else { 60 } ) ,
1001
1001
delay_fn : tokio:: time:: sleep,
1002
1002
} ;
1003
- let mut processor =
1003
+ let processor =
1004
1004
BatchSpanProcessor :: new ( Box :: new ( exporter) , config, runtime:: TokioCurrentThread ) ;
1005
1005
tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ; // skip the first
1006
1006
processor. on_end ( new_test_export_span_data ( ) ) ;
0 commit comments