diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-19 08:38:57 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-19 08:38:58 +0100 |
commit | 98ad8cec144900c7799772b3a53241825b416b4f (patch) | |
tree | 8a18df3e9ff4c4be5316112c0f02db72f9ef94f2 /build.rs | |
parent | 7207abccd9dccb15eb37f43a8f763cac99be14d4 (diff) |
feature gate named-entities (making phf optional)
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -7,20 +7,21 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[cfg(feature = "named-entities")] extern crate phf_codegen; -use std::collections::HashMap; -use std::env; -use std::fs::File; -use std::io::Write; -use std::path::Path; +#[cfg(feature = "named-entities")] +use {std::collections::HashMap, std::env, std::fs::File, std::io::Write, std::path::Path}; +#[cfg(feature = "named-entities")] mod entities; fn main() { + #[cfg(feature = "named-entities")] named_entities_to_phf(&Path::new(&env::var("OUT_DIR").unwrap()).join("named_entities.rs")); } +#[cfg(feature = "named-entities")] fn named_entities_to_phf(to: &Path) { let mut entities: HashMap<&str, (u32, u32)> = entities::NAMED_ENTITIES .iter() |