1
1
#[ cfg( feature = "blocking-io" ) ]
2
- use std:: io:: { BufRead , Read } ;
2
+ use std:: io:: Read ;
3
3
4
4
use bstr:: { BString , ByteSlice } ;
5
5
#[ cfg( all( not( feature = "blocking-io" ) , feature = "async-io" ) ) ]
@@ -106,16 +106,16 @@ async fn read_line_trait_method_reads_one_packet_line_at_a_time() -> crate::Resu
106
106
107
107
let mut out = String :: new ( ) ;
108
108
let mut r = rd. as_read ( ) ;
109
- r. read_line ( & mut out) . await ?;
109
+ r. read_line_to_string ( & mut out) . await ?;
110
110
assert_eq ! ( out, "808e50d724f604f69ab93c6da2919c014667bedb HEAD\0 multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed symref=HEAD:refs/heads/master object-format=sha1 agent=git/2.28.0\n " ) ;
111
111
out. clear ( ) ;
112
- r. read_line ( & mut out) . await ?;
112
+ r. read_line_to_string ( & mut out) . await ?;
113
113
assert_eq ! ( out, "808e50d724f604f69ab93c6da2919c014667bedb refs/heads/master\n " ) ;
114
114
out. clear ( ) ;
115
- r. read_line ( & mut out) . await ?;
115
+ r. read_line_to_string ( & mut out) . await ?;
116
116
assert_eq ! ( out, "" , "flush means empty lines…" ) ;
117
117
out. clear ( ) ;
118
- r. read_line ( & mut out) . await ?;
118
+ r. read_line_to_string ( & mut out) . await ?;
119
119
assert_eq ! ( out, "" , "…which can't be overcome unless the reader is reset" ) ;
120
120
assert_eq ! (
121
121
r. stopped_at( ) ,
@@ -127,18 +127,18 @@ async fn read_line_trait_method_reads_one_packet_line_at_a_time() -> crate::Resu
127
127
rd. reset ( ) ;
128
128
129
129
let mut r = rd. as_read ( ) ;
130
- r. read_line ( & mut out) . await ?;
130
+ r. read_line_to_string ( & mut out) . await ?;
131
131
assert_eq ! ( out, "NAK\n " ) ;
132
132
133
133
drop ( r) ;
134
134
135
135
let mut r = rd. as_read_with_sidebands ( |_, _| ( ) ) ;
136
136
out. clear ( ) ;
137
- r. read_line ( & mut out) . await ?;
137
+ r. read_line_to_string ( & mut out) . await ?;
138
138
assert_eq ! ( out, "&" ) ;
139
139
140
140
out. clear ( ) ;
141
- r. read_line ( & mut out) . await ?;
141
+ r. read_line_to_string ( & mut out) . await ?;
142
142
assert_eq ! ( out, "" ) ;
143
143
144
144
Ok ( ( ) )
@@ -199,7 +199,7 @@ async fn peek_past_an_actual_eof_is_an_error() -> crate::Result {
199
199
assert_eq ! ( res. expect( "one line" ) ??, b"ERR e" ) ;
200
200
201
201
let mut buf = String :: new ( ) ;
202
- reader. read_line ( & mut buf) . await ?;
202
+ reader. read_line_to_string ( & mut buf) . await ?;
203
203
assert_eq ! (
204
204
buf, "ERR e" ,
205
205
"by default ERR lines won't propagate as failure but are merely text"
@@ -223,7 +223,7 @@ async fn peek_past_a_delimiter_is_no_error() -> crate::Result {
223
223
assert_eq ! ( res. expect( "one line" ) ??, b"hello" ) ;
224
224
225
225
let mut buf = String :: new ( ) ;
226
- reader. read_line ( & mut buf) . await ?;
226
+ reader. read_line_to_string ( & mut buf) . await ?;
227
227
assert_eq ! ( buf, "hello" ) ;
228
228
229
229
let res = reader. peek_data_line ( ) . await ;
0 commit comments