diff options
Diffstat (limited to 'vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs')
-rw-r--r-- | vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs | 48 |
1 files changed, 13 insertions, 35 deletions
diff --git a/vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs b/vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs index 2d2cd542f..e5619b2f0 100644 --- a/vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs +++ b/vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs @@ -1,41 +1,19 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name GRAPHEME_BREAK_REV --reverse --longest --sparse --minimize --anchored --state-size 2 src/unicode/fsm/ [snip (arg too long)] +// regex-cli generate serialize sparse dfa --minimize --start-kind anchored --reverse --match-kind all --no-captures --shrink --rustfmt --safe GRAPHEME_BREAK_REV 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_REV: ::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_rev.bigendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static GRAPHEME_BREAK_REV: ::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_rev.littleendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } +pub static GRAPHEME_BREAK_REV: Lazy<DFA<&'static [u8]>> = Lazy::new(|| { + #[cfg(target_endian = "big")] + static BYTES: &'static [u8] = + include_bytes!("grapheme_break_rev.bigendian.dfa"); + #[cfg(target_endian = "little")] + static BYTES: &'static [u8] = + include_bytes!("grapheme_break_rev.littleendian.dfa"); + let (dfa, _) = + DFA::from_bytes(BYTES).expect("serialized DFA should be valid"); + dfa }); |