@@ -342,7 +342,7 @@ impl Status {
342342 Err ( err) => err,
343343 } ;
344344
345- #[ cfg( feature = "transport " ) ]
345+ #[ cfg( feature = "server " ) ]
346346 let err = match err. downcast :: < h2:: Error > ( ) {
347347 Ok ( h2) => {
348348 return Ok ( Status :: from_h2_error ( h2) ) ;
@@ -359,7 +359,7 @@ impl Status {
359359 }
360360
361361 // FIXME: bubble this into `transport` and expose generic http2 reasons.
362- #[ cfg( feature = "transport " ) ]
362+ #[ cfg( feature = "server " ) ]
363363 fn from_h2_error ( err : Box < h2:: Error > ) -> Status {
364364 let code = Self :: code_from_h2 ( & err) ;
365365
@@ -368,7 +368,7 @@ impl Status {
368368 status
369369 }
370370
371- #[ cfg( feature = "transport " ) ]
371+ #[ cfg( feature = "server " ) ]
372372 fn code_from_h2 ( err : & h2:: Error ) -> Code {
373373 // See https://github.com/grpc/grpc/blob/3977c30/doc/PROTOCOL-HTTP2.md#errors
374374 match err. reason ( ) {
@@ -388,7 +388,7 @@ impl Status {
388388 }
389389 }
390390
391- #[ cfg( feature = "transport " ) ]
391+ #[ cfg( feature = "server " ) ]
392392 fn to_h2_error ( & self ) -> h2:: Error {
393393 // conservatively transform to h2 error codes...
394394 let reason = match self . code {
@@ -404,7 +404,7 @@ impl Status {
404404 ///
405405 /// Returns Some if there's a way to handle the error, or None if the information from this
406406 /// hyper error, but perhaps not its source, should be ignored.
407- #[ cfg( feature = "transport " ) ]
407+ #[ cfg( feature = "server " ) ]
408408 fn from_hyper_error ( err : & hyper:: Error ) -> Option < Status > {
409409 // is_timeout results from hyper's keep-alive logic
410410 // (https://docs.rs/hyper/0.14.11/src/hyper/error.rs.html#192-194). Per the grpc spec
@@ -614,12 +614,12 @@ fn find_status_in_source_chain(err: &(dyn Error + 'static)) -> Option<Status> {
614614 } ) ;
615615 }
616616
617- #[ cfg( feature = "transport" ) ]
617+ #[ cfg( any ( feature = "server" , feature = "channel" ) ) ]
618618 if let Some ( timeout) = err. downcast_ref :: < crate :: transport:: TimeoutExpired > ( ) {
619619 return Some ( Status :: cancelled ( timeout. to_string ( ) ) ) ;
620620 }
621621
622- #[ cfg( feature = "transport " ) ]
622+ #[ cfg( feature = "server " ) ]
623623 if let Some ( hyper) = err
624624 . downcast_ref :: < hyper:: Error > ( )
625625 . and_then ( Status :: from_hyper_error)
@@ -666,14 +666,14 @@ fn invalid_header_value_byte<Error: fmt::Display>(err: Error) -> Status {
666666 )
667667}
668668
669- #[ cfg( feature = "transport " ) ]
669+ #[ cfg( feature = "server " ) ]
670670impl From < h2:: Error > for Status {
671671 fn from ( err : h2:: Error ) -> Self {
672672 Status :: from_h2_error ( Box :: new ( err) )
673673 }
674674}
675675
676- #[ cfg( feature = "transport " ) ]
676+ #[ cfg( feature = "server " ) ]
677677impl From < Status > for h2:: Error {
678678 fn from ( status : Status ) -> Self {
679679 status. to_h2_error ( )
0 commit comments