Skip to content

Commit

Permalink
Swap the methods some examples / tests are using
Browse files Browse the repository at this point in the history
Bytes-backed slices need to use _into() as the data may need to be
decoded.
  • Loading branch information
dralley committed Aug 15, 2022
1 parent f7ea0a9 commit 5175316
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn test_issue94() {
let mut reader = Reader::from_reader(&data[..]);
reader.trim_text(true);
loop {
match reader.read_event() {
match reader.read_event_into(&mut Vec::new()) {
Ok(Eof) | Err(..) => break,
_ => (),
}
Expand Down
2 changes: 1 addition & 1 deletion tests/xmlrs_reader_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ fn test_bytes(input: &[u8], output: &[u8], trim: bool) {

let mut decoder = reader.decoder();
loop {
let line = match reader.read_resolved_event() {
let line = match reader.read_resolved_event_into(&mut Vec::new()) {
Ok((_, Event::Decl(e))) => {
// Declaration could change decoder
decoder = reader.decoder();
Expand Down

0 comments on commit 5175316

Please sign in to comment.