Skip to content

Commit

Permalink
Make "unicase + macros" features work
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed May 3, 2022
1 parent baac7d0 commit 11bb242
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
# MSRV and nightly
version: [1.51.0, nightly]
version: [1.60.0, nightly]
steps:
- uses: actions/checkout@v2

Expand All @@ -23,7 +23,7 @@ jobs:
rustup override set ${{ matrix.version }}
- name: Rustfmt check
if: matrix.version == '1.51.0'
if: matrix.version == '1.60.0'
run: |
rustup component add rustfmt
cargo fmt --all -- --check
Expand All @@ -32,7 +32,7 @@ jobs:
run: cargo test --workspace --exclude=phf_codegen_test

- name: phf_macros UI test
if: matrix.version == '1.51.0'
if: matrix.version == '1.60.0'
working-directory: phf_macros_tests
run: cargo test -- --ignored --test-threads=1

Expand All @@ -42,3 +42,6 @@ jobs:
- name: no_std build check
working-directory: phf
run: cargo build --no-default-features

- name: unicase + macros features check
run: cargo check -p unicase-example
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

* Bump up MSRV to 1.60
* Now the `unicase` feature works fine with the `macros` feature, doesn't need to import `phf-macros` directly.

## 0.10.1

* Allow serializing `Map` ([#244])
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
@@ -1,6 +1,7 @@
[workspace]
members = [
"phf",
"phf/examples/unicase-example",
"phf_codegen",
"phf_codegen/test",
"phf_generator",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -13,7 +13,7 @@ a 100,000 entry map in roughly .4 seconds. By default statistics are not
produced, but if you set the environment variable `PHF_STATS` it will issue
a compiler note about how long it took.

MSRV (minimum supported rust version) is Rust 1.46.
MSRV (minimum supported rust version) is Rust 1.60.

## Usage

Expand Down
3 changes: 2 additions & 1 deletion phf/Cargo.toml
Expand Up @@ -7,6 +7,7 @@ description = "Runtime support for perfect hash function data structures"
repository = "https://github.com/sfackler/rust-phf"
edition = "2018"
readme = "../README.md"
rust-version = "1.60"

[lib]
name = "phf"
Expand All @@ -17,7 +18,7 @@ test = false
default = ["std"]
std = ["phf_shared/std"]
uncased = ["phf_shared/uncased"]
unicase = ["phf_shared/unicase"]
unicase = ["phf_macros?/unicase", "phf_shared/unicase"]
macros = [
"phf_macros",
"proc-macro-hack",
Expand Down
11 changes: 11 additions & 0 deletions phf/examples/unicase-example/Cargo.toml
@@ -0,0 +1,11 @@
[package]
name = "unicase-example"
version = "0.1.0"
edition = "2021"
rust-version = "1.60"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
phf = { version = "0.10", features = ["macros", "unicase"] }
unicase = "2"
9 changes: 9 additions & 0 deletions phf/examples/unicase-example/src/main.rs
@@ -0,0 +1,9 @@
use phf::phf_map;
use unicase::UniCase;

pub static MAP: phf::Map<UniCase<&'static str>, isize> = phf_map!(
UniCase::ascii("Foo") => 0,
UniCase::unicode("Bar") => 1,
);

fn main() {}
2 changes: 1 addition & 1 deletion phf/src/lib.rs
Expand Up @@ -7,7 +7,7 @@
//! produced, but if you set the environment variable `PHF_STATS` it will issue
//! a compiler note about how long it took.
//!
//! MSRV (minimum supported rust version) is Rust 1.46.
//! MSRV (minimum supported rust version) is Rust 1.60.
//!
//! ## Usage
//!
Expand Down
1 change: 1 addition & 0 deletions phf_codegen/Cargo.toml
Expand Up @@ -7,6 +7,7 @@ description = "Codegen library for PHF types"
repository = "https://github.com/sfackler/rust-phf"
edition = "2018"
readme = "../README.md"
rust-version = "1.60"

[dependencies]
phf_generator = "0.10.0"
Expand Down
1 change: 1 addition & 0 deletions phf_generator/Cargo.toml
Expand Up @@ -6,6 +6,7 @@ license = "MIT"
description = "PHF generation logic"
repository = "https://github.com/sfackler/rust-phf"
edition = "2018"
rust-version = "1.60"

[dependencies]
rand = { version = "0.8", features = ["small_rng"] }
Expand Down
1 change: 1 addition & 0 deletions phf_macros/Cargo.toml
Expand Up @@ -8,6 +8,7 @@ description = "Macros to generate types in the phf crate"
repository = "https://github.com/sfackler/rust-phf"
readme = "../README.md"
include = ["src/lib.rs"]
rust-version = "1.60"

[lib]
proc-macro = true
Expand Down
1 change: 1 addition & 0 deletions phf_macros_tests/Cargo.toml
Expand Up @@ -3,6 +3,7 @@ name = "phf_macros_tests"
version = "0.1.0"
authors = ["Yuki Okushi <jtitor@2k36.org>"]
edition = "2018"
rust-version = "1.60"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
1 change: 1 addition & 0 deletions phf_shared/Cargo.toml
Expand Up @@ -6,6 +6,7 @@ license = "MIT"
description = "Support code shared by PHF libraries"
repository = "https://github.com/sfackler/rust-phf"
edition = "2018"
rust-version = "1.60"

[lib]
name = "phf_shared"
Expand Down

0 comments on commit 11bb242

Please sign in to comment.