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 be13af6 commit 81d930d
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 @@ -100,7 +100,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 @@ -373,7 +373,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 81d930d

Please sign in to comment.