Skip to content

Commit

Permalink
Reexport macros through phf crate
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Jan 3, 2019
1 parent 5ae4131 commit 588fd1a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions phf/Cargo.toml
Expand Up @@ -15,6 +15,9 @@ test = false
[features]
core = ["phf_shared/core"]
unicase = ["phf_shared/unicase"]
macros = ["phf_macros"]

[dependencies]
phf_shared = { version = "=0.7.23", path = "../phf_shared" }

phf_macros = { version = "0.7.23", optional = true, path = "../phf_macros" }
5 changes: 5 additions & 0 deletions phf/src/lib.rs
Expand Up @@ -11,6 +11,11 @@
extern crate std as core;

extern crate phf_shared;
#[cfg(feature = "macros")]
extern crate phf_macros;

#[cfg(feature = "phf_macros")]
pub use phf_macros::*;

use core::ops::Deref;

Expand Down
6 changes: 3 additions & 3 deletions phf_macros/Cargo.toml
@@ -1,14 +1,14 @@
[package]
name = "phf_macros"
version = "0.1.0"
version = "0.7.23"
authors = ["Steven Fackler <sfackler@gmail.com>"]
edition = "2018"

[lib]
proc-macro = true

[dependencies]
syn = { version = "0.15", features = ["full", "extra-traits"] }
syn = { version = "0.15", features = ["full"] }
quote = "0.6"
proc-macro2 = "0.4"

Expand All @@ -17,4 +17,4 @@ phf_shared = { version = "=0.7.23", path = "../phf_shared" }

[dev-dependencies]
compiletest_rs = "0.3"
phf = { version = "0.7.23", path = "../phf" }
phf = { version = "0.7.23", path = "../phf", features = ["macros"] }
3 changes: 1 addition & 2 deletions phf_macros/tests/compile-fail/bad-syntax.rs
@@ -1,9 +1,8 @@
#![feature(proc_macro_hygiene)]

extern crate phf;
extern crate phf_macros;

use phf_macros::phf_map;
use phf::phf_map;

static MAP: phf::Map<u32, u32> = phf_map! {
Signature::
Expand Down
12 changes: 4 additions & 8 deletions phf_macros/tests/test.rs
Expand Up @@ -2,8 +2,7 @@

mod map {
use std::collections::{HashMap, HashSet};
use phf;
use phf_macros::phf_map;
use phf::phf_map;

#[allow(dead_code)]
static TRAILING_COMMA: phf::Map<&'static str, isize> = phf_map!(
Expand Down Expand Up @@ -251,8 +250,7 @@ mod map {

mod set {
use std::collections::HashSet;
use phf;
use phf_macros::phf_set;
use phf::phf_set;

#[allow(dead_code)]
static TRAILING_COMMA: phf::Set<&'static str> = phf_set! {
Expand Down Expand Up @@ -310,8 +308,7 @@ mod set {
}

mod ordered_map {
use phf;
use phf_macros::phf_ordered_map;
use phf::phf_ordered_map;

#[allow(dead_code)]
static TRAILING_COMMA: phf::OrderedMap<&'static str, isize> = phf_ordered_map!(
Expand Down Expand Up @@ -434,8 +431,7 @@ mod ordered_map {
}

mod ordered_set {
use phf;
use phf_macros::phf_ordered_set;
use phf::phf_ordered_set;

#[allow(dead_code)]
static TRAILING_COMMA: phf::OrderedSet<&'static str> = phf_ordered_set! {
Expand Down

0 comments on commit 588fd1a

Please sign in to comment.