Skip to content

Commit 40c1cfc

Browse files
committed
Inline ReaderState::close_expanded_empty
1 parent f063917 commit 40c1cfc

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/reader/state.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,6 @@ impl ReaderState {
290290
}
291291
}
292292

293-
#[inline]
294-
pub fn close_expanded_empty(&mut self) -> Result<Event<'static>> {
295-
self.pending = false;
296-
let name = self
297-
.opened_buffer
298-
.split_off(self.opened_starts.pop().unwrap());
299-
Ok(Event::End(BytesEnd::wrap(name.into())))
300-
}
301-
302293
/// Get the decoder, used to decode bytes, read by this reader, to the strings.
303294
///
304295
/// If [`encoding`] feature is enabled, the used encoding may change after
@@ -476,7 +467,11 @@ impl ReaderState {
476467
/// event.
477468
pub fn pending_end(&mut self) -> Option<Event<'static>> {
478469
if self.pending {
479-
return Some(self.close_expanded_empty().unwrap());
470+
self.pending = false;
471+
let name = self
472+
.opened_buffer
473+
.split_off(self.opened_starts.pop().unwrap());
474+
return Some(Event::End(BytesEnd::wrap(name.into())));
480475
}
481476
None
482477
}

0 commit comments

Comments
 (0)