@@ -27,7 +27,7 @@ pub enum FlightError {
2727 /// Returned when functionality is not yet available.
2828 NotYetImplemented ( String ) ,
2929 /// Error from the underlying tonic library
30- Tonic ( Box < tonic:: Status > ) ,
30+ Tonic ( tonic:: Status ) ,
3131 /// Some unexpected message was received
3232 ProtocolError ( String ) ,
3333 /// An error occurred during decoding
@@ -74,7 +74,7 @@ impl Error for FlightError {
7474
7575impl From < tonic:: Status > for FlightError {
7676 fn from ( status : tonic:: Status ) -> Self {
77- Self :: Tonic ( Box :: new ( status) )
77+ Self :: Tonic ( status)
7878 }
7979}
8080
@@ -91,7 +91,7 @@ impl From<FlightError> for tonic::Status {
9191 match value {
9292 FlightError :: Arrow ( e) => tonic:: Status :: internal ( e. to_string ( ) ) ,
9393 FlightError :: NotYetImplemented ( e) => tonic:: Status :: internal ( e) ,
94- FlightError :: Tonic ( status) => * status,
94+ FlightError :: Tonic ( status) => status,
9595 FlightError :: ProtocolError ( e) => tonic:: Status :: internal ( e) ,
9696 FlightError :: DecodeError ( e) => tonic:: Status :: internal ( e) ,
9797 FlightError :: ExternalError ( e) => tonic:: Status :: internal ( e. to_string ( ) ) ,
@@ -147,10 +147,4 @@ mod test {
147147 let source = root_error. downcast_ref :: < FlightError > ( ) . unwrap ( ) ;
148148 assert ! ( matches!( source, FlightError :: DecodeError ( _) ) ) ;
149149 }
150-
151- #[ test]
152- fn test_error_size ( ) {
153- // use Box in variants to keep this size down
154- assert_eq ! ( std:: mem:: size_of:: <FlightError >( ) , 32 ) ;
155- }
156150}
0 commit comments