From fd71c31288d72920a72eb73a69bc7325e7b1ba48 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 24 Oct 2015 10:33:46 -0700 Subject: [PATCH] Use libstd debug builders --- .travis.yml | 4 ++-- phf/Cargo.toml | 1 - phf/src/lib.rs | 1 - phf/src/map.rs | 3 +-- phf/src/ordered_map.rs | 3 +-- phf/src/ordered_set.rs | 3 +-- phf/src/set.rs | 3 +-- 7 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0b0de9c2..8b3029d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: false rust: - nightly - beta -- stable +- 1.2.0 script: - (test $TRAVIS_RUST_VERSION != "nightly" || (cd phf_macros && cargo test)) - (test $TRAVIS_RUST_VERSION != "nightly" || (cd phf_macros && cargo test --features stats)) @@ -11,4 +11,4 @@ script: - (test $TRAVIS_RUST_VERSION != "nightly" || (cd phf_shared && cargo build --features core)) - (test $TRAVIS_RUST_VERSION != "nightly" || (cd phf && cargo build --features core)) - (cd phf_codegen && cargo test) -- (cd phf_codegen/test && cargo test) \ No newline at end of file +- (cd phf_codegen/test && cargo test) diff --git a/phf/Cargo.toml b/phf/Cargo.toml index 0ae8781d..160ce637 100644 --- a/phf/Cargo.toml +++ b/phf/Cargo.toml @@ -16,5 +16,4 @@ test = false core = ["phf_shared/core"] [dependencies] -debug-builders = "0.1" phf_shared = { version = "=0.7.5", path = "../phf_shared" } diff --git a/phf/src/lib.rs b/phf/src/lib.rs index 875ae97e..a63cc84a 100644 --- a/phf/src/lib.rs +++ b/phf/src/lib.rs @@ -11,7 +11,6 @@ #[cfg(not(feature = "core"))] extern crate std as core; -extern crate debug_builders; extern crate phf_shared; pub use phf_shared::PhfHash; diff --git a/phf/src/map.rs b/phf/src/map.rs index 382e0c0e..663b78d9 100644 --- a/phf/src/map.rs +++ b/phf/src/map.rs @@ -1,5 +1,4 @@ //! An immutable map constructed at compile time. -use debug_builders::DebugMap; use core::borrow::Borrow; use core::ops::Index; use core::slice; @@ -26,7 +25,7 @@ pub struct Map { impl fmt::Debug for Map where K: fmt::Debug, V: fmt::Debug { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - self.entries().fold(DebugMap::new(fmt), |b, (k, v)| b.entry(k, v)).finish() + fmt.debug_map().entries(self.entries()).finish() } } diff --git a/phf/src/ordered_map.rs b/phf/src/ordered_map.rs index 246aef9b..85400f98 100644 --- a/phf/src/ordered_map.rs +++ b/phf/src/ordered_map.rs @@ -1,5 +1,4 @@ //! An order-preserving immutable map constructed at compile time. -use debug_builders::DebugMap; use core::borrow::Borrow; use core::iter::IntoIterator; use core::ops::Index; @@ -32,7 +31,7 @@ pub struct OrderedMap { impl fmt::Debug for OrderedMap where K: fmt::Debug, V: fmt::Debug { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - self.entries().fold(DebugMap::new(fmt), |b, (k, v)| b.entry(k, v)).finish() + fmt.debug_map().entries(self.entries()).finish() } } diff --git a/phf/src/ordered_set.rs b/phf/src/ordered_set.rs index 6722e6dd..68ae3953 100644 --- a/phf/src/ordered_set.rs +++ b/phf/src/ordered_set.rs @@ -1,5 +1,4 @@ //! An order-preserving immutable set constructed at compile time. -use debug_builders::DebugSet; use core::borrow::Borrow; use core::iter::IntoIterator; use core::fmt; @@ -23,7 +22,7 @@ pub struct OrderedSet { impl fmt::Debug for OrderedSet where T: fmt::Debug { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - self.iter().fold(DebugSet::new(fmt), |b, e| b.entry(e)).finish() + fmt.debug_set().entries(self).finish() } } diff --git a/phf/src/set.rs b/phf/src/set.rs index 6b2f523a..bb7a9d73 100644 --- a/phf/src/set.rs +++ b/phf/src/set.rs @@ -1,5 +1,4 @@ //! An immutable set constructed at compile time. -use debug_builders::DebugSet; use core::borrow::Borrow; use core::iter::IntoIterator; use core::fmt; @@ -22,7 +21,7 @@ pub struct Set { impl fmt::Debug for Set where T: fmt::Debug { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - self.iter().fold(DebugSet::new(fmt), |b, e| b.entry(e)).finish() + fmt.debug_set().entries(self).finish() } }