mirror of https://git.sr.ht/~stygianentity/bincode
change error message
This commit is contained in:
parent
ab3f627ca8
commit
e4ce955928
|
|
@ -173,7 +173,7 @@ impl<'a, W: Write> serde::Serializer for &'a mut Serializer<W> {
|
|||
}
|
||||
|
||||
fn serialize_seq(self, len: Option<usize>) -> SerializeResult<Self::SerializeSeq> {
|
||||
let len = try!(len.ok_or(SerializeError::custom("do not know how to serialize a sequence with no length")));
|
||||
let len = try!(len.ok_or(SerializeError::custom("bincode can't serialize a sequence with no length")));
|
||||
try!(self.serialize_u64(len as u64));
|
||||
Ok(Compound {ser: self})
|
||||
}
|
||||
|
|
@ -201,7 +201,7 @@ impl<'a, W: Write> serde::Serializer for &'a mut Serializer<W> {
|
|||
}
|
||||
|
||||
fn serialize_map(self, len: Option<usize>) -> SerializeResult<Self::SerializeMap> {
|
||||
let len = try!(len.ok_or(SerializeError::custom("do not know how to serialize a map with no length")));
|
||||
let len = try!(len.ok_or(SerializeError::custom("bincode can't serialize a map with no length")));
|
||||
try!(self.serialize_u64(len as u64));
|
||||
Ok(Compound {ser: self})
|
||||
}
|
||||
|
|
@ -368,7 +368,7 @@ impl<'a> serde::Serializer for &'a mut SizeChecker {
|
|||
}
|
||||
|
||||
fn serialize_seq(self, len: Option<usize>) -> SerializeResult<Self::SerializeSeq> {
|
||||
let len = try!(len.ok_or(SerializeError::custom("do not know how to serialize a sequence with no length")));
|
||||
let len = try!(len.ok_or(SerializeError::custom("bincode can't serialize a sequence with no length")));
|
||||
|
||||
try!(self.serialize_u64(len as u64));
|
||||
Ok(SizeCompound {ser: self})
|
||||
|
|
@ -398,7 +398,7 @@ impl<'a> serde::Serializer for &'a mut SizeChecker {
|
|||
|
||||
fn serialize_map(self, len: Option<usize>) -> SerializeResult<Self::SerializeMap>
|
||||
{
|
||||
let len = try!(len.ok_or(SerializeError::custom("do not know how to serialize a map with no length")));
|
||||
let len = try!(len.ok_or(SerializeError::custom("bincode can't serialize a map with no length")));
|
||||
|
||||
try!(self.serialize_u64(len as u64));
|
||||
Ok(SizeCompound {ser: self})
|
||||
|
|
|
|||
Loading…
Reference in New Issue