diff --git a/.travis.yml b/.travis.yml index b7ee145..05ea9e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ rust: - stable os: - linux - - osx script: - cargo build - cargo test diff --git a/Cargo.toml b/Cargo.toml index ae233cd..6bee177 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "string_cache" -version = "0.3.0" # Also update README.md when making a semver-breaking change +version = "0.4.0" # Also update README.md when making a semver-breaking change authors = [ "The Servo Project Developers" ] description = "A string interning library for Rust, developed as part of the Servo project." license = "MIT / Apache-2.0" @@ -27,12 +27,9 @@ log-events = ["rustc-serialize"] # Use unstable features to optimize space and time (memory and CPU usage). unstable = [] -# HeapSizeOf support -heap_size = ["heapsize"] - [dependencies] lazy_static = "0.2" -serde = "0.8" +serde = "0.9" phf_shared = "0.7.4" debug_unreachable = "0.1.1" rustc-serialize = { version = "0.3", optional = true } diff --git a/README.md b/README.md index d244f69..43cf6fb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ In `Cargo.toml`: ```toml [dependencies] -string_cache = "0.3" +string_cache = "0.4" ``` In `lib.rs`: @@ -31,7 +31,7 @@ In `Cargo.toml`: build = "build.rs" [dependencies] -string_cache = "0.3" +string_cache = "0.4" [build-dependencies] string_cache_codegen = "0.3" diff --git a/src/atom.rs b/src/atom.rs index 1b12148..25e258c 100644 --- a/src/atom.rs +++ b/src/atom.rs @@ -228,11 +228,6 @@ impl Atom { pub fn get_hash(&self) -> u32 { ((self.unsafe_data >> 32) ^ self.unsafe_data) as u32 } - - pub fn with_str(&self, cb: F) -> Output - where F: FnOnce(&str) -> Output { - cb(self) - } } impl Default for Atom { @@ -431,16 +426,16 @@ impl AsRef for Atom { } impl Serialize for Atom { - fn serialize(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer { + fn serialize(&self, serializer: S) -> Result where S: Serializer { let string: &str = self.as_ref(); string.serialize(serializer) } } impl Deserialize for Atom { - fn deserialize(deserializer: &mut D) -> Result where D: Deserializer { + fn deserialize(deserializer: D) -> Result where D: Deserializer { let string: String = try!(Deserialize::deserialize(deserializer)); - Ok(Atom::from(&*string)) + Ok(Atom::from(string)) } } diff --git a/src/lib.rs b/src/lib.rs index 6229344..b7961c3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ #[cfg(all(test, feature = "unstable"))] extern crate test; #[cfg(feature = "log-events")] extern crate rustc_serialize; -#[cfg(feature = "heapsize")] #[macro_use] extern crate heapsize; +#[cfg(feature = "heapsize")] extern crate heapsize; #[cfg(test)] extern crate rand; #[macro_use] extern crate lazy_static; #[macro_use] extern crate debug_unreachable;