Skip to content

Commit 470cfd2

Browse files
committed
FIX: Update serde impls for Array changes
1 parent 7c33afb commit 470cfd2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/array_string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ impl<'de, A> Deserialize<'de> for ArrayString<A>
547547
type Value = ArrayString<A>;
548548

549549
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
550-
write!(formatter, "a string no more than {} bytes long", A::capacity())
550+
write!(formatter, "a string no more than {} bytes long", A::CAPACITY)
551551
}
552552

553553
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ impl<'de, T: Deserialize<'de>, A: Array<Item=T>> Deserialize<'de> for ArrayVec<A
11191119
type Value = ArrayVec<A>;
11201120

11211121
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
1122-
write!(formatter, "an array with no more than {} items", A::capacity())
1122+
write!(formatter, "an array with no more than {} items", A::CAPACITY)
11231123
}
11241124

11251125
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
11291129

11301130
while let Some(value) = try!(seq.next_element()) {
11311131
if let Err(_) = values.try_push(value) {
1132-
return Err(SA::Error::invalid_length(A::capacity() + 1, &self));
1132+
return Err(SA::Error::invalid_length(A::CAPACITY + 1, &self));
11331133
}
11341134
}
11351135

0 commit comments

Comments
 (0)