fix drain

master
Edward Shen 2021-03-01 16:37:34 -05:00
parent cd2f58c920
commit e9598831cc
Signed by: edward
GPG Key ID: 19182661E818369F
1 changed files with 1 additions and 2 deletions

View File

@ -97,8 +97,7 @@ impl MutableValue<'_, '_, '_> {
/// the Value event(s) are replaced with a single new event containing the
/// new value.
pub fn set_bytes(&mut self, input: Vec<u8>) {
self.section.drain(self.index..self.size);
self.section.drain(self.index..self.index + self.size);
self.size = 1;
self.section
.insert(self.index, Event::Value(Cow::Owned(input)));