From 517531610833834f2e835be2fdda52bf38790a06 Mon Sep 17 00:00:00 2001 From: Daniel Alley Date: Sat, 13 Aug 2022 23:27:49 -0400 Subject: [PATCH] Swap the methods some examples / tests are using Bytes-backed slices need to use _into() as the data may need to be decoded. --- tests/test.rs | 2 +- tests/xmlrs_reader_tests.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test.rs b/tests/test.rs index e822b6e2..9c3dcf0c 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -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, _ => (), } diff --git a/tests/xmlrs_reader_tests.rs b/tests/xmlrs_reader_tests.rs index 46cb3662..85229bc6 100644 --- a/tests/xmlrs_reader_tests.rs +++ b/tests/xmlrs_reader_tests.rs @@ -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();