summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarkus Ast <m@rkusa.st>2020-06-23 21:18:32 +0200
committerGitHub <noreply@github.com>2020-06-23 15:18:32 -0400
commited387356811110f8a63738051121ae0893898276 (patch)
treed8293b117f2c5dce6c68592a10409b920e1a7562 /src
parent165b80ddd4736ac0e89130bc8a30d714b9a8e6c1 (diff)
Fix deserializing empty sequences (#31)
Diffstat (limited to 'src')
-rw-r--r--src/de/parse.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/de/parse.rs b/src/de/parse.rs
index ffd1a3f..75ae134 100644
--- a/src/de/parse.rs
+++ b/src/de/parse.rs
@@ -333,6 +333,11 @@ impl<'a> Parser<'a> {
}
}
}
+ // Skip empty byte sequences (e.g. leading `&`, trailing `&`, `&&`, ...)
+ b'&' => {
+ self.clear_acc();
+ Ok(true)
+ }
// This means the key should be a root key
// of the form "abc" or "abc[..=]"
// We do actually allow integer keys here since they cannot