@@ -1362,9 +1362,9 @@ mod tests {
1362
1362
1363
1363
#[ test]
1364
1364
fn test_span_exporter_immutable_reference ( ) {
1365
- use std:: sync:: atomic:: { AtomicBool , Ordering } ;
1366
1365
use crate :: error:: OTelSdkError ;
1367
-
1366
+ use std:: sync:: atomic:: { AtomicBool , Ordering } ;
1367
+
1368
1368
// Simple test exporter that demonstrates the &self pattern
1369
1369
#[ derive( Debug ) ]
1370
1370
struct TestExporter {
@@ -1377,7 +1377,7 @@ mod tests {
1377
1377
is_shutdown : AtomicBool :: new ( false ) ,
1378
1378
}
1379
1379
}
1380
-
1380
+
1381
1381
fn is_shutdown ( & self ) -> bool {
1382
1382
self . is_shutdown . load ( Ordering :: Relaxed )
1383
1383
}
@@ -1390,35 +1390,35 @@ mod tests {
1390
1390
}
1391
1391
Ok ( ( ) )
1392
1392
}
1393
-
1393
+
1394
1394
fn shutdown ( & self ) -> OTelSdkResult {
1395
1395
self . is_shutdown . store ( true , Ordering :: Relaxed ) ;
1396
1396
Ok ( ( ) )
1397
1397
}
1398
-
1398
+
1399
1399
fn shutdown_with_timeout ( & self , _timeout : Duration ) -> OTelSdkResult {
1400
1400
self . shutdown ( )
1401
1401
}
1402
-
1402
+
1403
1403
fn force_flush ( & self ) -> OTelSdkResult {
1404
1404
Ok ( ( ) )
1405
1405
}
1406
1406
}
1407
1407
1408
1408
let exporter = TestExporter :: new ( ) ;
1409
-
1409
+
1410
1410
// These methods now work with &self
1411
1411
assert ! ( !exporter. is_shutdown( ) ) ;
1412
-
1412
+
1413
1413
let result = exporter. shutdown ( ) ;
1414
1414
assert ! ( result. is_ok( ) ) ;
1415
-
1415
+
1416
1416
assert ! ( exporter. is_shutdown( ) ) ;
1417
-
1417
+
1418
1418
// Test that export fails after shutdown
1419
1419
let export_result = futures_executor:: block_on ( exporter. export ( vec ! [ ] ) ) ;
1420
1420
assert ! ( export_result. is_err( ) ) ;
1421
-
1421
+
1422
1422
// Test force_flush
1423
1423
let flush_result = exporter. force_flush ( ) ;
1424
1424
assert ! ( flush_result. is_ok( ) ) ;
0 commit comments