summaryrefslogtreecommitdiffstats
path: root/vendor/bstr/src/unicode/fsm/simple_word_fwd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bstr/src/unicode/fsm/simple_word_fwd.rs')
-rw-r--r--vendor/bstr/src/unicode/fsm/simple_word_fwd.rs48
1 files changed, 13 insertions, 35 deletions
diff --git a/vendor/bstr/src/unicode/fsm/simple_word_fwd.rs b/vendor/bstr/src/unicode/fsm/simple_word_fwd.rs
index 32b69b611..97bd006fb 100644
--- a/vendor/bstr/src/unicode/fsm/simple_word_fwd.rs
+++ b/vendor/bstr/src/unicode/fsm/simple_word_fwd.rs
@@ -1,41 +1,19 @@
// DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY:
//
-// ucd-generate dfa --name SIMPLE_WORD_FWD --sparse --minimize --state-size 2 src/unicode/fsm/ \w
+// regex-cli generate serialize sparse dfa --minimize --start-kind anchored --shrink --rustfmt --safe SIMPLE_WORD_FWD src/unicode/fsm/ \w
//
-// 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 SIMPLE_WORD_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!("simple_word_fwd.bigendian.dfa"),
- };
-
- unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) }
-});
-
-#[cfg(target_endian = "little")]
-pub static SIMPLE_WORD_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!("simple_word_fwd.littleendian.dfa"),
- };
-
- unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) }
+pub static SIMPLE_WORD_FWD: Lazy<DFA<&'static [u8]>> = Lazy::new(|| {
+ #[cfg(target_endian = "big")]
+ static BYTES: &'static [u8] =
+ include_bytes!("simple_word_fwd.bigendian.dfa");
+ #[cfg(target_endian = "little")]
+ static BYTES: &'static [u8] =
+ include_bytes!("simple_word_fwd.littleendian.dfa");
+ let (dfa, _) =
+ DFA::from_bytes(BYTES).expect("serialized DFA should be valid");
+ dfa
});