summaryrefslogtreecommitdiffstats
path: root/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs')
-rw-r--r--vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs48
1 files changed, 13 insertions, 35 deletions
diff --git a/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs b/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs
index dea4a7e3e..ccba7d952 100644
--- a/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs
+++ b/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs
@@ -1,41 +1,19 @@
// DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY:
//
-// ucd-generate dfa --name GRAPHEME_BREAK_FWD --sparse --minimize --anchored --state-size 2 src/unicode/fsm/ [snip (arg too long)]
+// regex-cli generate serialize sparse dfa --minimize --start-kind anchored --shrink --rustfmt --safe GRAPHEME_BREAK_FWD src/unicode/fsm/ <snip: arg too long>
//
-// ucd-generate 0.2.12 is available on crates.io.
+// regex-cli 0.0.1 is available on crates.io.
-#[cfg(target_endian = "big")]
-pub static GRAPHEME_BREAK_FWD: ::once_cell::sync::Lazy<
- ::regex_automata::SparseDFA<&'static [u8], u16>,
-> = ::once_cell::sync::Lazy::new(|| {
- #[repr(C)]
- struct Aligned<B: ?Sized> {
- _align: [u8; 0],
- bytes: B,
- }
+use regex_automata::{dfa::sparse::DFA, util::lazy::Lazy};
- static ALIGNED: &'static Aligned<[u8]> = &Aligned {
- _align: [],
- bytes: *include_bytes!("grapheme_break_fwd.bigendian.dfa"),
- };
-
- unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) }
-});
-
-#[cfg(target_endian = "little")]
-pub static GRAPHEME_BREAK_FWD: ::once_cell::sync::Lazy<
- ::regex_automata::SparseDFA<&'static [u8], u16>,
-> = ::once_cell::sync::Lazy::new(|| {
- #[repr(C)]
- struct Aligned<B: ?Sized> {
- _align: [u8; 0],
- bytes: B,
- }
-
- static ALIGNED: &'static Aligned<[u8]> = &Aligned {
- _align: [],
- bytes: *include_bytes!("grapheme_break_fwd.littleendian.dfa"),
- };
-
- unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) }
+pub static GRAPHEME_BREAK_FWD: Lazy<DFA<&'static [u8]>> = Lazy::new(|| {
+ #[cfg(target_endian = "big")]
+ static BYTES: &'static [u8] =
+ include_bytes!("grapheme_break_fwd.bigendian.dfa");
+ #[cfg(target_endian = "little")]
+ static BYTES: &'static [u8] =
+ include_bytes!("grapheme_break_fwd.littleendian.dfa");
+ let (dfa, _) =
+ DFA::from_bytes(BYTES).expect("serialized DFA should be valid");
+ dfa
});