undo the breaking change introduced in 0.7.6
This commit is contained in:
parent
e0bd57d63c
commit
96cd910c92
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "0.7.6"
|
version = "0.7.7"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "A generic serialization/deserialization framework"
|
description = "A generic serialization/deserialization framework"
|
||||||
|
@ -578,7 +578,7 @@ pub trait Visitor {
|
|||||||
fn visit_char<E>(&mut self, v: char) -> Result<Self::Value, E>
|
fn visit_char<E>(&mut self, v: char) -> Result<Self::Value, E>
|
||||||
where E: Error,
|
where E: Error,
|
||||||
{
|
{
|
||||||
self.visit_str(::core::str::from_utf8(::utils::encode_utf8(v).as_slice()).unwrap())
|
self.visit_str(::utils::encode_utf8(v).as_str())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `visit_str` deserializes a `&str` into a `Value`.
|
/// `visit_str` deserializes a `&str` into a `Value`.
|
||||||
|
@ -122,11 +122,11 @@ pub trait Serializer {
|
|||||||
/// Serializes a `f64` value.
|
/// Serializes a `f64` value.
|
||||||
fn serialize_f64(&mut self, v: f64) -> Result<(), Self::Error>;
|
fn serialize_f64(&mut self, v: f64) -> Result<(), Self::Error>;
|
||||||
|
|
||||||
/// Serializes a character. By default it serializes as bytes containing the UTF-8 encoding
|
/// Serializes a character. By default it serializes it as a `&str` containing a
|
||||||
/// of the character.
|
/// single character.
|
||||||
#[inline]
|
#[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_str(::utils::encode_utf8(v).as_str())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Serializes a `&str`.
|
/// Serializes a `&str`.
|
||||||
|
@ -40,9 +40,9 @@ pub struct EncodeUtf8 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl EncodeUtf8 {
|
impl EncodeUtf8 {
|
||||||
/// Returns the remaining bytes of this iterator as a slice.
|
// FIXME: use this from_utf8_unchecked, since we know it can never fail
|
||||||
pub fn as_slice(&self) -> &[u8] {
|
pub fn as_str(&self) -> &str {
|
||||||
&self.buf[self.pos..]
|
::core::str::from_utf8(&self.buf[self.pos..]).unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_codegen"
|
name = "serde_codegen"
|
||||||
version = "0.7.6"
|
version = "0.7.7"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "Macros to auto-generate implementations for the serde framework"
|
description = "Macros to auto-generate implementations for the serde framework"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_macros"
|
name = "serde_macros"
|
||||||
version = "0.7.6"
|
version = "0.7.7"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "Macros to auto-generate implementations for the serde framework"
|
description = "Macros to auto-generate implementations for the serde framework"
|
||||||
@ -18,12 +18,12 @@ nightly-testing = ["clippy", "serde/nightly-testing", "serde_codegen/nightly-tes
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clippy = { version = "^0.*", optional = true }
|
clippy = { version = "^0.*", optional = true }
|
||||||
serde_codegen = { version = "^0.7.6", path = "../serde_codegen", default-features = false, features = ["nightly"] }
|
serde_codegen = { version = "^0.7.7", path = "../serde_codegen", default-features = false, features = ["nightly"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
compiletest_rs = "^0.1.1"
|
compiletest_rs = "^0.1.1"
|
||||||
rustc-serialize = "^0.3.16"
|
rustc-serialize = "^0.3.16"
|
||||||
serde = { version = "^0.7.6", path = "../serde" }
|
serde = { version = "^0.7.7", path = "../serde" }
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "test"
|
name = "test"
|
||||||
|
Loading…
Reference in New Issue
Block a user