Skip to content

Commit 913f0db

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 7531971 commit 913f0db

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
@@ -98,7 +98,7 @@ fn test_issue94() {
9898
let mut reader = Reader::from_reader(&data[..]);
9999
reader.trim_text(true);
100100
loop {
101-
match reader.read_event() {
101+
match reader.read_event_into(&mut Vec::new()) {
102102
Ok(Eof) | Err(..) => break,
103103
_ => (),
104104
}

tests/xmlrs_reader_tests.rs

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

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

0 commit comments

Comments
 (0)