mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-14 07:01:02 +00:00
Address nits
This commit is contained in:
@@ -1024,8 +1024,6 @@ impl<T, E> Deserialize for Result<T, E> where T: Deserialize, E: Deserialize {
|
|||||||
|
|
||||||
#[cfg(all(not(feature = "std"), not(feature = "collections")))]
|
#[cfg(all(not(feature = "std"), not(feature = "collections")))]
|
||||||
fn visit_usize<E>(&mut self, value: usize) -> Result<Field, E> where E: Error {
|
fn visit_usize<E>(&mut self, value: usize) -> Result<Field, E> where E: Error {
|
||||||
#[cfg(feature = "collections")]
|
|
||||||
use collections::string::ToString;
|
|
||||||
match value {
|
match value {
|
||||||
0 => Ok(Field::Ok),
|
0 => Ok(Field::Ok),
|
||||||
1 => Ok(Field::Err),
|
1 => Ok(Field::Err),
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ pub trait Serializer {
|
|||||||
|
|
||||||
/// Serializes a character. By default it serializes as bytes containing the UTF-8 encoding
|
/// Serializes a character. By default it serializes as bytes containing the UTF-8 encoding
|
||||||
/// of the character.
|
/// of the character.
|
||||||
|
#[inline]
|
||||||
fn serialize_char(&mut self, v: char) -> Result<(), Self::Error> {
|
fn serialize_char(&mut self, v: char) -> Result<(), Self::Error> {
|
||||||
self.serialize_bytes(::utils::encode_utf8(v).as_slice())
|
self.serialize_bytes(::utils::encode_utf8(v).as_slice())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user