@@ -398,35 +398,47 @@ impl fmt::Debug for Stream {
398398 . field ( "state" , & self . state )
399399 . field ( "is_counted" , & self . is_counted )
400400 . field ( "ref_count" , & self . ref_count )
401- . field ( "next_pending_send" , & self . next_pending_send )
402- . field ( "is_pending_send" , & self . is_pending_send )
401+ . h2_field_some ( "next_pending_send" , & self . next_pending_send )
402+ . h2_field_if ( "is_pending_send" , & self . is_pending_send )
403403 . field ( "send_flow" , & self . send_flow )
404404 . field ( "requested_send_capacity" , & self . requested_send_capacity )
405405 . field ( "buffered_send_data" , & self . buffered_send_data )
406- . field ( "send_task" , & self . send_task . as_ref ( ) . map ( |_| ( ) ) )
407- . field ( "pending_send" , & self . pending_send )
408- . field (
406+ . h2_field_some ( "send_task" , & self . send_task . as_ref ( ) . map ( |_| ( ) ) )
407+ . h2_field_if_then (
408+ "pending_send" ,
409+ !self . pending_send . is_empty ( ) ,
410+ & self . pending_send ,
411+ )
412+ . h2_field_some (
409413 "next_pending_send_capacity" ,
410414 & self . next_pending_send_capacity ,
411415 )
412- . field ( "is_pending_send_capacity" , & self . is_pending_send_capacity )
413- . field ( "send_capacity_inc" , & self . send_capacity_inc )
414- . field ( "next_open" , & self . next_open )
415- . field ( "is_pending_open" , & self . is_pending_open )
416- . field ( "is_pending_push" , & self . is_pending_push )
417- . field ( "next_pending_accept" , & self . next_pending_accept )
418- . field ( "is_pending_accept" , & self . is_pending_accept )
416+ . h2_field_if ( "is_pending_send_capacity" , & self . is_pending_send_capacity )
417+ . h2_field_if ( "send_capacity_inc" , & self . send_capacity_inc )
418+ . h2_field_some ( "next_open" , & self . next_open )
419+ . h2_field_if ( "is_pending_open" , & self . is_pending_open )
420+ . h2_field_if ( "is_pending_push" , & self . is_pending_push )
421+ . h2_field_some ( "next_pending_accept" , & self . next_pending_accept )
422+ . h2_field_if ( "is_pending_accept" , & self . is_pending_accept )
419423 . field ( "recv_flow" , & self . recv_flow )
420424 . field ( "in_flight_recv_data" , & self . in_flight_recv_data )
421- . field ( "next_window_update" , & self . next_window_update )
422- . field ( "is_pending_window_update" , & self . is_pending_window_update )
423- . field ( "reset_at" , & self . reset_at )
424- . field ( "next_reset_expire" , & self . next_reset_expire )
425- . field ( "pending_recv" , & self . pending_recv )
426- . field ( "is_recv" , & self . is_recv )
427- . field ( "recv_task" , & self . recv_task . as_ref ( ) . map ( |_| ( ) ) )
428- . field ( "push_task" , & self . push_task . as_ref ( ) . map ( |_| ( ) ) )
429- . field ( "pending_push_promises" , & self . pending_push_promises )
425+ . h2_field_some ( "next_window_update" , & self . next_window_update )
426+ . h2_field_if ( "is_pending_window_update" , & self . is_pending_window_update )
427+ . h2_field_some ( "reset_at" , & self . reset_at )
428+ . h2_field_some ( "next_reset_expire" , & self . next_reset_expire )
429+ . h2_field_if_then (
430+ "pending_recv" ,
431+ !self . pending_recv . is_empty ( ) ,
432+ & self . pending_recv ,
433+ )
434+ . h2_field_if ( "is_recv" , & self . is_recv )
435+ . h2_field_some ( "recv_task" , & self . recv_task . as_ref ( ) . map ( |_| ( ) ) )
436+ . h2_field_some ( "push_task" , & self . push_task . as_ref ( ) . map ( |_| ( ) ) )
437+ . h2_field_if_then (
438+ "pending_push_promises" ,
439+ !self . pending_push_promises . is_empty ( ) ,
440+ & self . pending_push_promises ,
441+ )
430442 . field ( "content_length" , & self . content_length )
431443 . finish ( )
432444 }
0 commit comments