Skip to content

Commit f243cda

Browse files
committed
Swap the methods some examples / tests are using
Bytes-backed slices need to use _into() as the data may need to be decoded.
1 parent 91f6f1d commit f243cda

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn test_issue94() {
101101
let mut reader = Reader::from_reader(&data[..]);
102102
reader.trim_text(true);
103103
loop {
104-
match reader.read_event() {
104+
match reader.read_event_into(&mut Vec::new()) {
105105
Ok(Eof) | Err(..) => break,
106106
_ => (),
107107
}

tests/xmlrs_reader_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ fn test_bytes(input: &[u8], output: &[u8], trim: bool) {
373373

374374
let mut decoder = reader.decoder();
375375
loop {
376-
let line = match reader.read_resolved_event() {
376+
let line = match reader.read_resolved_event_into(&mut Vec::new()) {
377377
Ok((_, Event::Decl(e))) => {
378378
// Declaration could change decoder
379379
decoder = reader.decoder();

0 commit comments

Comments
 (0)