@@ -19,7 +19,6 @@ use alloc::vec::Vec;
1919
2020use anyhow:: { Error , Result , anyhow, bail} ;
2121use flatbuffers:: size_prefixed_root;
22- #[ cfg( feature = "tracing" ) ]
2322use tracing:: { Span , instrument} ;
2423
2524use super :: guest_error:: GuestError ;
@@ -284,7 +283,7 @@ pub enum ReturnType {
284283}
285284
286285impl From < & ParameterValue > for ParameterType {
287- #[ cfg_attr ( feature = "tracing" , instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
286+ #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
288287 fn from ( value : & ParameterValue ) -> Self {
289288 match * value {
290289 ParameterValue :: Int ( _) => ParameterType :: Int ,
@@ -303,7 +302,7 @@ impl From<&ParameterValue> for ParameterType {
303302impl TryFrom < Parameter < ' _ > > for ParameterValue {
304303 type Error = Error ;
305304
306- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
305+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
307306 fn try_from ( param : Parameter < ' _ > ) -> Result < Self > {
308307 let value = param. value_type ( ) ;
309308 let result = match value {
@@ -343,7 +342,7 @@ impl TryFrom<Parameter<'_>> for ParameterValue {
343342}
344343
345344impl From < ParameterType > for FbParameterType {
346- #[ cfg_attr ( feature = "tracing" , instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
345+ #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
347346 fn from ( value : ParameterType ) -> Self {
348347 match value {
349348 ParameterType :: Int => FbParameterType :: hlint,
@@ -360,7 +359,7 @@ impl From<ParameterType> for FbParameterType {
360359}
361360
362361impl From < ReturnType > for FbReturnType {
363- #[ cfg_attr ( feature = "tracing" , instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
362+ #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
364363 fn from ( value : ReturnType ) -> Self {
365364 match value {
366365 ReturnType :: Int => FbReturnType :: hlint,
@@ -379,7 +378,7 @@ impl From<ReturnType> for FbReturnType {
379378
380379impl TryFrom < FbParameterType > for ParameterType {
381380 type Error = Error ;
382- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
381+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
383382 fn try_from ( value : FbParameterType ) -> Result < Self > {
384383 match value {
385384 FbParameterType :: hlint => Ok ( ParameterType :: Int ) ,
@@ -400,7 +399,7 @@ impl TryFrom<FbParameterType> for ParameterType {
400399
401400impl TryFrom < FbReturnType > for ReturnType {
402401 type Error = Error ;
403- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
402+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
404403 fn try_from ( value : FbReturnType ) -> Result < Self > {
405404 match value {
406405 FbReturnType :: hlint => Ok ( ReturnType :: Int ) ,
@@ -422,7 +421,7 @@ impl TryFrom<FbReturnType> for ReturnType {
422421
423422impl TryFrom < ParameterValue > for i32 {
424423 type Error = Error ;
425- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
424+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
426425 fn try_from ( value : ParameterValue ) -> Result < Self > {
427426 match value {
428427 ParameterValue :: Int ( v) => Ok ( v) ,
@@ -435,7 +434,7 @@ impl TryFrom<ParameterValue> for i32 {
435434
436435impl TryFrom < ParameterValue > for u32 {
437436 type Error = Error ;
438- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
437+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
439438 fn try_from ( value : ParameterValue ) -> Result < Self > {
440439 match value {
441440 ParameterValue :: UInt ( v) => Ok ( v) ,
@@ -448,7 +447,7 @@ impl TryFrom<ParameterValue> for u32 {
448447
449448impl TryFrom < ParameterValue > for i64 {
450449 type Error = Error ;
451- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
450+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
452451 fn try_from ( value : ParameterValue ) -> Result < Self > {
453452 match value {
454453 ParameterValue :: Long ( v) => Ok ( v) ,
@@ -461,7 +460,7 @@ impl TryFrom<ParameterValue> for i64 {
461460
462461impl TryFrom < ParameterValue > for u64 {
463462 type Error = Error ;
464- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
463+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
465464 fn try_from ( value : ParameterValue ) -> Result < Self > {
466465 match value {
467466 ParameterValue :: ULong ( v) => Ok ( v) ,
@@ -474,7 +473,7 @@ impl TryFrom<ParameterValue> for u64 {
474473
475474impl TryFrom < ParameterValue > for f32 {
476475 type Error = Error ;
477- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
476+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
478477 fn try_from ( value : ParameterValue ) -> Result < Self > {
479478 match value {
480479 ParameterValue :: Float ( v) => Ok ( v) ,
@@ -487,7 +486,7 @@ impl TryFrom<ParameterValue> for f32 {
487486
488487impl TryFrom < ParameterValue > for f64 {
489488 type Error = Error ;
490- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
489+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
491490 fn try_from ( value : ParameterValue ) -> Result < Self > {
492491 match value {
493492 ParameterValue :: Double ( v) => Ok ( v) ,
@@ -500,7 +499,7 @@ impl TryFrom<ParameterValue> for f64 {
500499
501500impl TryFrom < ParameterValue > for String {
502501 type Error = Error ;
503- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
502+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
504503 fn try_from ( value : ParameterValue ) -> Result < Self > {
505504 match value {
506505 ParameterValue :: String ( v) => Ok ( v) ,
@@ -513,7 +512,7 @@ impl TryFrom<ParameterValue> for String {
513512
514513impl TryFrom < ParameterValue > for bool {
515514 type Error = Error ;
516- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
515+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
517516 fn try_from ( value : ParameterValue ) -> Result < Self > {
518517 match value {
519518 ParameterValue :: Bool ( v) => Ok ( v) ,
@@ -526,7 +525,7 @@ impl TryFrom<ParameterValue> for bool {
526525
527526impl TryFrom < ParameterValue > for Vec < u8 > {
528527 type Error = Error ;
529- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
528+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
530529 fn try_from ( value : ParameterValue ) -> Result < Self > {
531530 match value {
532531 ParameterValue :: VecBytes ( v) => Ok ( v) ,
@@ -539,7 +538,7 @@ impl TryFrom<ParameterValue> for Vec<u8> {
539538
540539impl TryFrom < ReturnValue > for i32 {
541540 type Error = Error ;
542- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
541+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
543542 fn try_from ( value : ReturnValue ) -> Result < Self > {
544543 match value {
545544 ReturnValue :: Int ( v) => Ok ( v) ,
@@ -552,7 +551,7 @@ impl TryFrom<ReturnValue> for i32 {
552551
553552impl TryFrom < ReturnValue > for u32 {
554553 type Error = Error ;
555- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
554+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
556555 fn try_from ( value : ReturnValue ) -> Result < Self > {
557556 match value {
558557 ReturnValue :: UInt ( v) => Ok ( v) ,
@@ -565,7 +564,7 @@ impl TryFrom<ReturnValue> for u32 {
565564
566565impl TryFrom < ReturnValue > for i64 {
567566 type Error = Error ;
568- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
567+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
569568 fn try_from ( value : ReturnValue ) -> Result < Self > {
570569 match value {
571570 ReturnValue :: Long ( v) => Ok ( v) ,
@@ -578,7 +577,7 @@ impl TryFrom<ReturnValue> for i64 {
578577
579578impl TryFrom < ReturnValue > for u64 {
580579 type Error = Error ;
581- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
580+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
582581 fn try_from ( value : ReturnValue ) -> Result < Self > {
583582 match value {
584583 ReturnValue :: ULong ( v) => Ok ( v) ,
@@ -591,7 +590,7 @@ impl TryFrom<ReturnValue> for u64 {
591590
592591impl TryFrom < ReturnValue > for f32 {
593592 type Error = Error ;
594- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
593+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
595594 fn try_from ( value : ReturnValue ) -> Result < Self > {
596595 match value {
597596 ReturnValue :: Float ( v) => Ok ( v) ,
@@ -604,7 +603,7 @@ impl TryFrom<ReturnValue> for f32 {
604603
605604impl TryFrom < ReturnValue > for f64 {
606605 type Error = Error ;
607- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
606+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
608607 fn try_from ( value : ReturnValue ) -> Result < Self > {
609608 match value {
610609 ReturnValue :: Double ( v) => Ok ( v) ,
@@ -617,7 +616,7 @@ impl TryFrom<ReturnValue> for f64 {
617616
618617impl TryFrom < ReturnValue > for String {
619618 type Error = Error ;
620- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
619+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
621620 fn try_from ( value : ReturnValue ) -> Result < Self > {
622621 match value {
623622 ReturnValue :: String ( v) => Ok ( v) ,
@@ -630,7 +629,7 @@ impl TryFrom<ReturnValue> for String {
630629
631630impl TryFrom < ReturnValue > for bool {
632631 type Error = Error ;
633- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
632+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
634633 fn try_from ( value : ReturnValue ) -> Result < Self > {
635634 match value {
636635 ReturnValue :: Bool ( v) => Ok ( v) ,
@@ -643,7 +642,7 @@ impl TryFrom<ReturnValue> for bool {
643642
644643impl TryFrom < ReturnValue > for Vec < u8 > {
645644 type Error = Error ;
646- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
645+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
647646 fn try_from ( value : ReturnValue ) -> Result < Self > {
648647 match value {
649648 ReturnValue :: VecBytes ( v) => Ok ( v) ,
@@ -656,7 +655,7 @@ impl TryFrom<ReturnValue> for Vec<u8> {
656655
657656impl TryFrom < ReturnValue > for ( ) {
658657 type Error = Error ;
659- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
658+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
660659 fn try_from ( value : ReturnValue ) -> Result < Self > {
661660 match value {
662661 ReturnValue :: Void ( ( ) ) => Ok ( ( ) ) ,
@@ -669,7 +668,7 @@ impl TryFrom<ReturnValue> for () {
669668
670669impl TryFrom < ReturnValueBox < ' _ > > for ReturnValue {
671670 type Error = Error ;
672- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
671+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
673672 fn try_from ( return_value_box : ReturnValueBox < ' _ > ) -> Result < Self > {
674673 match return_value_box. value_type ( ) {
675674 FbReturnValue :: hlint => {
@@ -740,7 +739,7 @@ impl TryFrom<ReturnValueBox<'_>> for ReturnValue {
740739
741740impl TryFrom < & ReturnValue > for Vec < u8 > {
742741 type Error = Error ;
743- #[ cfg_attr ( feature = "tracing" , instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ) ]
742+ #[ instrument( err( Debug ) , skip_all, parent = Span :: current( ) , level= "Trace" ) ]
744743 fn try_from ( value : & ReturnValue ) -> Result < Vec < u8 > > {
745744 let mut builder = flatbuffers:: FlatBufferBuilder :: new ( ) ;
746745 let result_bytes = match value {
0 commit comments