@@ -34,7 +34,7 @@ fn read_event(c: &mut Criterion) {
3434 let mut count = criterion:: black_box ( 0 ) ;
3535 let mut buf = Vec :: new ( ) ;
3636 loop {
37- match r. read_event ( & mut buf) {
37+ match r. read_event_into ( & mut buf) {
3838 Ok ( Event :: Start ( _) ) | Ok ( Event :: Empty ( _) ) => count += 1 ,
3939 Ok ( Event :: Eof ) => break ,
4040 _ => ( ) ,
@@ -57,7 +57,7 @@ fn read_event(c: &mut Criterion) {
5757 let mut count = criterion:: black_box ( 0 ) ;
5858 let mut buf = Vec :: new ( ) ;
5959 loop {
60- match r. read_event ( & mut buf) {
60+ match r. read_event_into ( & mut buf) {
6161 Ok ( Event :: Start ( _) ) | Ok ( Event :: Empty ( _) ) => count += 1 ,
6262 Ok ( Event :: Eof ) => break ,
6363 _ => ( ) ,
@@ -137,7 +137,7 @@ fn bytes_text_unescaped(c: &mut Criterion) {
137137 let mut count = criterion:: black_box ( 0 ) ;
138138 let mut nbtxt = criterion:: black_box ( 0 ) ;
139139 loop {
140- match r. read_event ( & mut buf) {
140+ match r. read_event_into ( & mut buf) {
141141 Ok ( Event :: Start ( _) ) | Ok ( Event :: Empty ( _) ) => count += 1 ,
142142 Ok ( Event :: Text ( ref e) ) => nbtxt += e. unescaped ( ) . unwrap ( ) . len ( ) ,
143143 Ok ( Event :: Eof ) => break ,
@@ -175,7 +175,7 @@ fn bytes_text_unescaped(c: &mut Criterion) {
175175 let mut count = criterion:: black_box ( 0 ) ;
176176 let mut nbtxt = criterion:: black_box ( 0 ) ;
177177 loop {
178- match r. read_event ( & mut buf) {
178+ match r. read_event_into ( & mut buf) {
179179 Ok ( Event :: Start ( _) ) | Ok ( Event :: Empty ( _) ) => count += 1 ,
180180 Ok ( Event :: Text ( ref e) ) => nbtxt += e. unescaped ( ) . unwrap ( ) . len ( ) ,
181181 Ok ( Event :: Eof ) => break ,
@@ -215,7 +215,7 @@ fn one_event(c: &mut Criterion) {
215215 let mut r = Reader :: from_reader ( src. as_ref ( ) ) ;
216216 let mut nbtxt = criterion:: black_box ( 0 ) ;
217217 r. check_end_names ( false ) . check_comments ( false ) ;
218- match r. read_event ( & mut buf) {
218+ match r. read_event_into ( & mut buf) {
219219 Ok ( Event :: StartText ( e) ) => nbtxt += e. len ( ) ,
220220 something_else => panic ! ( "Did not expect {:?}" , something_else) ,
221221 } ;
@@ -235,7 +235,7 @@ fn one_event(c: &mut Criterion) {
235235 r. check_end_names ( false )
236236 . check_comments ( false )
237237 . trim_text ( true ) ;
238- match r. read_event ( & mut buf) {
238+ match r. read_event_into ( & mut buf) {
239239 Ok ( Event :: Start ( ref e) ) => nbtxt += e. len ( ) ,
240240 something_else => panic ! ( "Did not expect {:?}" , something_else) ,
241241 } ;
@@ -255,7 +255,7 @@ fn one_event(c: &mut Criterion) {
255255 r. check_end_names ( false )
256256 . check_comments ( false )
257257 . trim_text ( true ) ;
258- match r. read_event ( & mut buf) {
258+ match r. read_event_into ( & mut buf) {
259259 Ok ( Event :: Comment ( ref e) ) => nbtxt += e. unescaped ( ) . unwrap ( ) . len ( ) ,
260260 something_else => panic ! ( "Did not expect {:?}" , something_else) ,
261261 } ;
@@ -275,7 +275,7 @@ fn one_event(c: &mut Criterion) {
275275 r. check_end_names ( false )
276276 . check_comments ( false )
277277 . trim_text ( true ) ;
278- match r. read_event ( & mut buf) {
278+ match r. read_event_into ( & mut buf) {
279279 Ok ( Event :: CData ( ref e) ) => nbtxt += e. len ( ) ,
280280 something_else => panic ! ( "Did not expect {:?}" , something_else) ,
281281 } ;
@@ -298,7 +298,7 @@ fn attributes(c: &mut Criterion) {
298298 let mut count = criterion:: black_box ( 0 ) ;
299299 let mut buf = Vec :: new ( ) ;
300300 loop {
301- match r. read_event ( & mut buf) {
301+ match r. read_event_into ( & mut buf) {
302302 Ok ( Event :: Empty ( e) ) => {
303303 for attr in e. attributes ( ) {
304304 let _attr = attr. unwrap ( ) ;
@@ -321,7 +321,7 @@ fn attributes(c: &mut Criterion) {
321321 let mut count = criterion:: black_box ( 0 ) ;
322322 let mut buf = Vec :: new ( ) ;
323323 loop {
324- match r. read_event ( & mut buf) {
324+ match r. read_event_into ( & mut buf) {
325325 Ok ( Event :: Empty ( e) ) => {
326326 for attr in e. attributes ( ) . with_checks ( false ) {
327327 let _attr = attr. unwrap ( ) ;
@@ -344,7 +344,7 @@ fn attributes(c: &mut Criterion) {
344344 let mut count = criterion:: black_box ( 0 ) ;
345345 let mut buf = Vec :: new ( ) ;
346346 loop {
347- match r. read_event ( & mut buf) {
347+ match r. read_event_into ( & mut buf) {
348348 Ok ( Event :: Empty ( e) ) if e. name ( ) == QName ( b"player" ) => {
349349 for name in [ "num" , "status" , "avg" ] {
350350 if let Some ( _attr) = e. try_get_attribute ( name) . unwrap ( ) {
0 commit comments