Skip to content

Commit

Permalink
Remove core feature
Browse files Browse the repository at this point in the history
SipHash is in libstd again
  • Loading branch information
sfackler committed Feb 22, 2015
1 parent 822f4e3 commit d4c189a
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 46 deletions.
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,7 +1,6 @@
language: rust
script:
- (cd phf && cargo test)
- (cd phf && cargo test --features core)
- (cd phf_macros && cargo test --features stats)
- ./.travis/build_docs.sh
after_success:
Expand Down
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -16,10 +16,6 @@ produced, but if you use the `phf_mac` crate with the `stats` feature enabled

Documentation is available at https://sfackler.github.io/rust-phf/doc/phf

The `phf/core` feature will compile the `phf` crate with a dependency on
libcore instead of libstd, enabling use in environments where libstd will not
work.

Example
=======

Expand Down
3 changes: 0 additions & 3 deletions phf/Cargo.toml
Expand Up @@ -12,9 +12,6 @@ name = "phf"
path = "src/lib.rs"
test = false

[features]
core = ["phf_shared/core"]

[dependencies.phf_shared]
path = "../phf_shared"
version = "=0.6.9"
Expand Down
20 changes: 0 additions & 20 deletions phf/src/lib.rs
Expand Up @@ -36,14 +36,7 @@
#![doc(html_root_url="https://sfackler.github.io/rust-phf/doc")]
#![feature(core, no_std)]
#![warn(missing_docs)]
#![no_std]

#[macro_use]
#[cfg(feature = "core")]
extern crate core;
#[macro_use]
#[cfg(not(feature = "core"))]
extern crate std;
extern crate phf_shared;

pub use phf_shared::PhfHash;
Expand All @@ -60,16 +53,3 @@ pub mod map;
pub mod set;
pub mod ordered_map;
pub mod ordered_set;

#[cfg(feature = "core")]
mod std {
pub use core::{borrow, fmt, iter, option, ops, slice};
pub mod prelude {
pub use core::prelude as v1;
}
}

#[cfg(not(feature = "core"))]
mod core {
pub use std::{fmt, option, iter};
}
8 changes: 4 additions & 4 deletions phf/tests/test.rs
Expand Up @@ -338,13 +338,13 @@ mod ordered_map {

#[test]
fn test_entries() {
static MAP: phf::OrderedMap<&'static str, isize> = phf_ordered_map!(
static MAP: phf::OrderedMap<&'static str, i32> = phf_ordered_map!(
"foo" => 10,
"bar" => 11,
"baz" => 12,
);
let vec = MAP.entries().map(|(&k, &v)| (k, v)).collect::<Vec<_>>();
assert_eq!(vec, vec!(("foo", 10is), ("bar", 11), ("baz", 12)));
assert_eq!(vec, vec!(("foo", 10), ("bar", 11), ("baz", 12)));
}

#[test]
Expand All @@ -360,13 +360,13 @@ mod ordered_map {

#[test]
fn test_values() {
static MAP: phf::OrderedMap<&'static str, isize> = phf_ordered_map!(
static MAP: phf::OrderedMap<&'static str, i32> = phf_ordered_map!(
"foo" => 10,
"bar" => 11,
"baz" => 12,
);
let vec = MAP.values().map(|&v| v).collect::<Vec<_>>();
assert_eq!(vec, vec!(10is, 11, 12));
assert_eq!(vec, vec!(10, 11, 12));
}

#[test]
Expand Down
4 changes: 0 additions & 4 deletions phf_shared/Cargo.toml
Expand Up @@ -10,7 +10,3 @@ repository = "https://github.com/sfackler/rust-phf"
name = "phf_shared"
path = "src/lib.rs"
test = false

[features]

core = []
10 changes: 0 additions & 10 deletions phf_shared/src/lib.rs
@@ -1,19 +1,9 @@
#![feature(hash)]
#![cfg_attr(feature = "core", feature(no_std))]
#![cfg_attr(feature = "core", no_std)]
#![doc(html_root_url="http://sfackler.github.io/rust-phf/doc")]

#[cfg(feature = "core")]
extern crate core;

use std::str::StrExt;
use std::hash::{Hasher, Hash, SipHasher};

#[cfg(feature = "core")]
mod std {
pub use core::{slice, str, hash};
}

#[inline]
pub fn displace(f1: u32, f2: u32, d1: u32, d2: u32) -> u32 {
d2 + f1 * d1 + f2
Expand Down

0 comments on commit d4c189a

Please sign in to comment.