summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Scott <sam.scott89@gmail.com>2019-04-28 14:10:52 -0400
committerGitHub <noreply@github.com>2019-04-28 14:10:52 -0400
commita537fd60099760653da21778228de40c3b4b82d7 (patch)
tree05ec99441a04d3d3083fe350450eaa57caca0cb5 /src
parent00862926b8cb7db48f60654d984dd11001ad3c95 (diff)
Add comment to explain original byte reuse
Co-Authored-By: agrinman <agrinman@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/de/parse.rs2
1 files changed, 2 insertions, 0 deletions
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))
},