Skip to content

Commit

Permalink
Revert pest_meta::UNICODE_PROPERTY_NAMES const, and deprecated it.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Dec 23, 2022
1 parent 0b0248d commit 3aa0bf9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions meta/src/lib.rs
Expand Up @@ -20,9 +20,10 @@
#[macro_use]
extern crate pest;

use std::fmt::Display;

use once_cell::sync::Lazy;
use pest::error::Error;
use pest::unicode::unicode_property_names;
use std::fmt::Display;

pub mod ast;
pub mod optimizer;
Expand Down Expand Up @@ -67,3 +68,8 @@ pub fn parse_and_optimize(

Ok((defaults, optimizer::optimize(ast)))
}

#[doc(hidden)]
#[deprecated(note = "use `pest::unicode::unicode_property_names` instead")]
pub static UNICODE_PROPERTY_NAMES: Lazy<Vec<&str>> =
Lazy::new(|| unicode_property_names().collect::<Vec<_>>());
1 change: 1 addition & 0 deletions pest/src/unicode/mod.rs
Expand Up @@ -263,6 +263,7 @@ char_property_functions! {
];
}

// Return all available unicode property names
pub fn unicode_property_names() -> Box<dyn Iterator<Item = &'static str>> {
Box::new(
BINARY_PROPERTY_NAMES
Expand Down

0 comments on commit 3aa0bf9

Please sign in to comment.