@@ -101,7 +101,7 @@ const WANT_READY: usize = 2;
101101
102102impl Incoming {
103103 #[ cfg( all( feature = "http1" , any( feature = "client" , feature = "server" ) ) ) ]
104- pub ( crate ) fn new_channel ( content_length : DecodedLength , wanter : bool ) -> ( Sender , Incoming ) {
104+ pub ( crate ) fn channel ( content_length : DecodedLength , wanter : bool ) -> ( Sender , Incoming ) {
105105 let ( data_tx, data_rx) = mpsc:: channel ( 0 ) ;
106106 let ( trailers_tx, trailers_rx) = oneshot:: channel ( ) ;
107107
@@ -474,13 +474,13 @@ mod tests {
474474 eq ( Incoming :: empty ( ) , SizeHint :: with_exact ( 0 ) , "empty" ) ;
475475
476476 eq (
477- Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) . 1 ,
477+ Incoming :: channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) . 1 ,
478478 SizeHint :: new ( ) ,
479479 "channel" ,
480480 ) ;
481481
482482 eq (
483- Incoming :: new_channel ( DecodedLength :: new ( 4 ) , /*wanter =*/ false ) . 1 ,
483+ Incoming :: channel ( DecodedLength :: new ( 4 ) , /*wanter =*/ false ) . 1 ,
484484 SizeHint :: with_exact ( 4 ) ,
485485 "channel with length" ,
486486 ) ;
@@ -489,7 +489,7 @@ mod tests {
489489 #[ cfg( not( miri) ) ]
490490 #[ tokio:: test]
491491 async fn channel_abort ( ) {
492- let ( tx, mut rx) = Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) ;
492+ let ( tx, mut rx) = Incoming :: channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) ;
493493
494494 tx. abort ( ) ;
495495
@@ -500,8 +500,7 @@ mod tests {
500500 #[ cfg( all( not( miri) , feature = "http1" ) ) ]
501501 #[ tokio:: test]
502502 async fn channel_abort_when_buffer_is_full ( ) {
503- let ( mut tx, mut rx) =
504- Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) ;
503+ let ( mut tx, mut rx) = Incoming :: channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) ;
505504
506505 tx. try_send_data ( "chunk 1" . into ( ) ) . expect ( "send 1" ) ;
507506 // buffer is full, but can still send abort
@@ -523,7 +522,7 @@ mod tests {
523522 #[ cfg( feature = "http1" ) ]
524523 #[ test]
525524 fn channel_buffers_one ( ) {
526- let ( mut tx, _rx) = Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) ;
525+ let ( mut tx, _rx) = Incoming :: channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) ;
527526
528527 tx. try_send_data ( "chunk 1" . into ( ) ) . expect ( "send 1" ) ;
529528
@@ -535,14 +534,14 @@ mod tests {
535534 #[ cfg( not( miri) ) ]
536535 #[ tokio:: test]
537536 async fn channel_empty ( ) {
538- let ( _, mut rx) = Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) ;
537+ let ( _, mut rx) = Incoming :: channel ( DecodedLength :: CHUNKED , /*wanter =*/ false ) ;
539538
540539 assert ! ( rx. frame( ) . await . is_none( ) ) ;
541540 }
542541
543542 #[ test]
544543 fn channel_ready ( ) {
545- let ( mut tx, _rx) = Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter = */ false ) ;
544+ let ( mut tx, _rx) = Incoming :: channel ( DecodedLength :: CHUNKED , /*wanter = */ false ) ;
546545
547546 let mut tx_ready = tokio_test:: task:: spawn ( tx. ready ( ) ) ;
548547
@@ -551,8 +550,7 @@ mod tests {
551550
552551 #[ test]
553552 fn channel_wanter ( ) {
554- let ( mut tx, mut rx) =
555- Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter = */ true ) ;
553+ let ( mut tx, mut rx) = Incoming :: channel ( DecodedLength :: CHUNKED , /*wanter = */ true ) ;
556554
557555 let mut tx_ready = tokio_test:: task:: spawn ( tx. ready ( ) ) ;
558556 let mut rx_data = tokio_test:: task:: spawn ( rx. frame ( ) ) ;
@@ -573,7 +571,7 @@ mod tests {
573571
574572 #[ test]
575573 fn channel_notices_closure ( ) {
576- let ( mut tx, rx) = Incoming :: new_channel ( DecodedLength :: CHUNKED , /*wanter = */ true ) ;
574+ let ( mut tx, rx) = Incoming :: channel ( DecodedLength :: CHUNKED , /*wanter = */ true ) ;
577575
578576 let mut tx_ready = tokio_test:: task:: spawn ( tx. ready ( ) ) ;
579577
0 commit comments