crc_any/lookup_table.rs
1/// This enum hold lookup table for static know or dynamic created table
2pub(crate) enum LookUpTable<T: 'static> {
3 Static(&'static [T]),
4 Dynamic([T; 256]),
5}
6
7impl<T> core::ops::Deref for LookUpTable<T> {
8 type Target = [T];
9
10 fn deref(&self) -> &[T] {
11 match *self {
12 LookUpTable::Static(s) => s,
13 LookUpTable::Dynamic(ref d) => d,
14 }
15 }
16}