FIX: Update serde impls for Array changes
This commit is contained in:
+1
-1
@@ -547,7 +547,7 @@ impl<'de, A> Deserialize<'de> for ArrayString<A>
|
|||||||
type Value = ArrayString<A>;
|
type Value = ArrayString<A>;
|
||||||
|
|
||||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(formatter, "a string no more than {} bytes long", A::capacity())
|
write!(formatter, "a string no more than {} bytes long", A::CAPACITY)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
|
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
|
||||||
|
|||||||
+2
-2
@@ -1119,7 +1119,7 @@ impl<'de, T: Deserialize<'de>, A: Array<Item=T>> Deserialize<'de> for ArrayVec<A
|
|||||||
type Value = ArrayVec<A>;
|
type Value = ArrayVec<A>;
|
||||||
|
|
||||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(formatter, "an array with no more than {} items", A::capacity())
|
write!(formatter, "an array with no more than {} items", A::CAPACITY)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_seq<SA>(self, mut seq: SA) -> Result<Self::Value, SA::Error>
|
fn visit_seq<SA>(self, mut seq: SA) -> Result<Self::Value, SA::Error>
|
||||||
@@ -1129,7 +1129,7 @@ impl<'de, T: Deserialize<'de>, A: Array<Item=T>> Deserialize<'de> for ArrayVec<A
|
|||||||
|
|
||||||
while let Some(value) = try!(seq.next_element()) {
|
while let Some(value) = try!(seq.next_element()) {
|
||||||
if let Err(_) = values.try_push(value) {
|
if let Err(_) = values.try_push(value) {
|
||||||
return Err(SA::Error::invalid_length(A::capacity() + 1, &self));
|
return Err(SA::Error::invalid_length(A::CAPACITY + 1, &self));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user