From f25e6d3ea99788d5fdddf4c0d19179b9878715ad Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 5 Jul 2016 10:08:27 -0700 Subject: [PATCH] Close the seq before failing on invalid length Equivalent to what 0f9a930 does for maps. --- serde_codegen/src/de.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/serde_codegen/src/de.rs b/serde_codegen/src/de.rs index be3ff6ed..92aef10b 100644 --- a/serde_codegen/src/de.rs +++ b/serde_codegen/src/de.rs @@ -425,6 +425,7 @@ fn deserialize_seq( let $name = match $visit { Some(value) => { value }, None => { + try!(visitor.end()); return Err(_serde::de::Error::invalid_length($index_in_seq)); } };