Skip to content

Commit

Permalink
Use libstd debug builders
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Oct 24, 2015
1 parent 70f2ed9 commit fd71c31
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -3,12 +3,12 @@ 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))
- (test $TRAVIS_RUST_VERSION != "nightly" || (cd phf_macros && cargo bench))
- (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)
- (cd phf_codegen/test && cargo test)
1 change: 0 additions & 1 deletion phf/Cargo.toml
Expand Up @@ -16,5 +16,4 @@ test = false
core = ["phf_shared/core"]

[dependencies]
debug-builders = "0.1"
phf_shared = { version = "=0.7.5", path = "../phf_shared" }
1 change: 0 additions & 1 deletion phf/src/lib.rs
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions 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;
Expand All @@ -26,7 +25,7 @@ pub struct Map<K:'static, V:'static> {

impl<K, V> fmt::Debug for Map<K, V> 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()
}
}

Expand Down
3 changes: 1 addition & 2 deletions 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;
Expand Down Expand Up @@ -32,7 +31,7 @@ pub struct OrderedMap<K:'static, V:'static> {

impl<K, V> fmt::Debug for OrderedMap<K, V> 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()
}
}

Expand Down
3 changes: 1 addition & 2 deletions 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;
Expand All @@ -23,7 +22,7 @@ pub struct OrderedSet<T:'static> {

impl<T> fmt::Debug for OrderedSet<T> 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()
}
}

Expand Down
3 changes: 1 addition & 2 deletions 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;
Expand All @@ -22,7 +21,7 @@ pub struct Set<T:'static> {

impl<T> fmt::Debug for Set<T> 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()
}
}

Expand Down

0 comments on commit fd71c31

Please sign in to comment.