| 1 | // auto-generated by: jiff-cli generate unit-designator-match |
| 2 | |
| 3 | use crate::Unit; |
| 4 | |
| 5 | #[inline (always)] |
| 6 | pub(super) fn find(haystack: &[u8]) -> Option<(Unit, usize)> { |
| 7 | match haystack { |
| 8 | &[b'm' , b'i' , b'l' , b'l' , b'i' , b's' , b'e' , b'c' , b'o' , b'n' , b'd' , b's' , ..] => { |
| 9 | Some((Unit::Millisecond, 12)) |
| 10 | } |
| 11 | &[b'm' , b'i' , b'c' , b'r' , b'o' , b's' , b'e' , b'c' , b'o' , b'n' , b'd' , b's' , ..] => { |
| 12 | Some((Unit::Microsecond, 12)) |
| 13 | } |
| 14 | &[b'n' , b'a' , b'n' , b'o' , b's' , b'e' , b'c' , b'o' , b'n' , b'd' , b's' , ..] => { |
| 15 | Some((Unit::Nanosecond, 11)) |
| 16 | } |
| 17 | &[b'm' , b'i' , b'l' , b'l' , b'i' , b's' , b'e' , b'c' , b'o' , b'n' , b'd' , ..] => { |
| 18 | Some((Unit::Millisecond, 11)) |
| 19 | } |
| 20 | &[b'm' , b'i' , b'c' , b'r' , b'o' , b's' , b'e' , b'c' , b'o' , b'n' , b'd' , ..] => { |
| 21 | Some((Unit::Microsecond, 11)) |
| 22 | } |
| 23 | &[b'n' , b'a' , b'n' , b'o' , b's' , b'e' , b'c' , b'o' , b'n' , b'd' , ..] => { |
| 24 | Some((Unit::Nanosecond, 10)) |
| 25 | } |
| 26 | &[b's' , b'e' , b'c' , b'o' , b'n' , b'd' , b's' , ..] => { |
| 27 | Some((Unit::Second, 7)) |
| 28 | } |
| 29 | &[b'm' , b'i' , b'n' , b'u' , b't' , b'e' , b's' , ..] => { |
| 30 | Some((Unit::Minute, 7)) |
| 31 | } |
| 32 | &[b' \xc2' , b' \xb5' , b's' , b'e' , b'c' , b's' , ..] => { |
| 33 | Some((Unit::Microsecond, 6)) |
| 34 | } |
| 35 | &[b's' , b'e' , b'c' , b'o' , b'n' , b'd' , ..] => Some((Unit::Second, 6)), |
| 36 | &[b'm' , b'o' , b'n' , b't' , b'h' , b's' , ..] => Some((Unit::Month, 6)), |
| 37 | &[b'm' , b'i' , b'n' , b'u' , b't' , b'e' , ..] => Some((Unit::Minute, 6)), |
| 38 | &[b'm' , b'i' , b'l' , b'l' , b'i' , b's' , ..] => { |
| 39 | Some((Unit::Millisecond, 6)) |
| 40 | } |
| 41 | &[b'm' , b'i' , b'c' , b'r' , b'o' , b's' , ..] => { |
| 42 | Some((Unit::Microsecond, 6)) |
| 43 | } |
| 44 | &[b' \xc2' , b' \xb5' , b's' , b'e' , b'c' , ..] => { |
| 45 | Some((Unit::Microsecond, 5)) |
| 46 | } |
| 47 | &[b'y' , b'e' , b'a' , b'r' , b's' , ..] => Some((Unit::Year, 5)), |
| 48 | &[b'w' , b'e' , b'e' , b'k' , b's' , ..] => Some((Unit::Week, 5)), |
| 49 | &[b'u' , b's' , b'e' , b'c' , b's' , ..] => Some((Unit::Microsecond, 5)), |
| 50 | &[b'n' , b's' , b'e' , b'c' , b's' , ..] => Some((Unit::Nanosecond, 5)), |
| 51 | &[b'n' , b'a' , b'n' , b'o' , b's' , ..] => Some((Unit::Nanosecond, 5)), |
| 52 | &[b'm' , b's' , b'e' , b'c' , b's' , ..] => Some((Unit::Millisecond, 5)), |
| 53 | &[b'm' , b'o' , b'n' , b't' , b'h' , ..] => Some((Unit::Month, 5)), |
| 54 | &[b'm' , b'i' , b'l' , b'l' , b'i' , ..] => Some((Unit::Millisecond, 5)), |
| 55 | &[b'm' , b'i' , b'c' , b'r' , b'o' , ..] => Some((Unit::Microsecond, 5)), |
| 56 | &[b'h' , b'o' , b'u' , b'r' , b's' , ..] => Some((Unit::Hour, 5)), |
| 57 | &[b'y' , b'e' , b'a' , b'r' , ..] => Some((Unit::Year, 4)), |
| 58 | &[b'w' , b'e' , b'e' , b'k' , ..] => Some((Unit::Week, 4)), |
| 59 | &[b'u' , b's' , b'e' , b'c' , ..] => Some((Unit::Microsecond, 4)), |
| 60 | &[b's' , b'e' , b'c' , b's' , ..] => Some((Unit::Second, 4)), |
| 61 | &[b'n' , b's' , b'e' , b'c' , ..] => Some((Unit::Nanosecond, 4)), |
| 62 | &[b'n' , b'a' , b'n' , b'o' , ..] => Some((Unit::Nanosecond, 4)), |
| 63 | &[b'm' , b's' , b'e' , b'c' , ..] => Some((Unit::Millisecond, 4)), |
| 64 | &[b'm' , b'i' , b'n' , b's' , ..] => Some((Unit::Minute, 4)), |
| 65 | &[b'h' , b'o' , b'u' , b'r' , ..] => Some((Unit::Hour, 4)), |
| 66 | &[b'd' , b'a' , b'y' , b's' , ..] => Some((Unit::Day, 4)), |
| 67 | &[b' \xc2' , b' \xb5' , b's' , ..] => Some((Unit::Microsecond, 3)), |
| 68 | &[b'y' , b'r' , b's' , ..] => Some((Unit::Year, 3)), |
| 69 | &[b'w' , b'k' , b's' , ..] => Some((Unit::Week, 3)), |
| 70 | &[b's' , b'e' , b'c' , ..] => Some((Unit::Second, 3)), |
| 71 | &[b'm' , b'o' , b's' , ..] => Some((Unit::Month, 3)), |
| 72 | &[b'm' , b'i' , b'n' , ..] => Some((Unit::Minute, 3)), |
| 73 | &[b'h' , b'r' , b's' , ..] => Some((Unit::Hour, 3)), |
| 74 | &[b'd' , b'a' , b'y' , ..] => Some((Unit::Day, 3)), |
| 75 | &[b'y' , b'r' , ..] => Some((Unit::Year, 2)), |
| 76 | &[b'w' , b'k' , ..] => Some((Unit::Week, 2)), |
| 77 | &[b'u' , b's' , ..] => Some((Unit::Microsecond, 2)), |
| 78 | &[b'n' , b's' , ..] => Some((Unit::Nanosecond, 2)), |
| 79 | &[b'm' , b's' , ..] => Some((Unit::Millisecond, 2)), |
| 80 | &[b'm' , b'o' , ..] => Some((Unit::Month, 2)), |
| 81 | &[b'h' , b'r' , ..] => Some((Unit::Hour, 2)), |
| 82 | &[b'y' , ..] => Some((Unit::Year, 1)), |
| 83 | &[b'w' , ..] => Some((Unit::Week, 1)), |
| 84 | &[b's' , ..] => Some((Unit::Second, 1)), |
| 85 | &[b'm' , ..] => Some((Unit::Minute, 1)), |
| 86 | &[b'h' , ..] => Some((Unit::Hour, 1)), |
| 87 | &[b'd' , ..] => Some((Unit::Day, 1)), |
| 88 | _ => None, |
| 89 | } |
| 90 | } |
| 91 | |