From e9598831cc591f48b39aa2c5874a4f521157346a Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Mon, 1 Mar 2021 16:37:34 -0500 Subject: [PATCH] fix drain --- src/file.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/file.rs b/src/file.rs index 128d803..53be5d6 100644 --- a/src/file.rs +++ b/src/file.rs @@ -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) { - 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)));