From a537fd60099760653da21778228de40c3b4b82d7 Mon Sep 17 00:00:00 2001 From: Sam Scott Date: Sun, 28 Apr 2019 14:10:52 -0400 Subject: Add comment to explain original byte reuse Co-Authored-By: agrinman --- src/de/parse.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/de/parse.rs b/src/de/parse.rs index 3718c57..d1cd147 100644 --- a/src/de/parse.rs +++ b/src/de/parse.rs @@ -239,6 +239,8 @@ impl<'a> Parser<'a> { Cow::Borrowed(_) => { match replaced { Cow::Borrowed(_) => { + // In this case, neither method made replacements, so we + // reuse the original bytes let res = str::from_utf8(&self.inner[self.acc.0..self.acc.1 - 1])?; Ok(Cow::Borrowed(res)) }, -- cgit v1.2.3