fn try_time_unit(&mut self) -> Option<TimeUnit> {
        if self.peek[0].0 == CatTokenKind::Text {
            match self.peek[0].1.extract().as_str() {
                "s" => Some(TimeUnit::Second),
                "ms" => Some(TimeUnit::MilliSecond),
                "us" => Some(TimeUnit::MicroSecond),
                "ns" => Some(TimeUnit::NanoSecond),
                "ps" => Some(TimeUnit::PicoSecond),
                "fs" => Some(TimeUnit::FemtoSecond),
                _ => None,
            }
        } else {
            None
        }
    }
/// Try to parse the next text token as a time unit.
Try to parse the next text token as a time unit.
Try to parse the next text token as a time unit .
fn try_time_unit(&mut self) -> Option<TimeUnit> {
        if self.peek[0].0 == CatTokenKind::Text {
            match self.peek[0].1.extract().as_str() {
                "s" => Some(TimeUnit::Second),
                "ms" => Some(TimeUnit::MilliSecond),
                "us" => Some(TimeUnit::MicroSecond),
                "ns" => Some(TimeUnit::NanoSecond),
                "ps" => Some(TimeUnit::PicoSecond),
                "fs" => Some(TimeUnit::FemtoSecond),
                _ => None,
            }
        } else {
            None
        }
    }
fn try_time_unit ( & mut self ) -> Option < TimeUnit > { if self . peek [ 0 ] . 0 == CatTokenKind :: Text { match self . peek [ 0 ] . 1 . extract ( ) . as_str ( ) { " " => Some ( TimeUnit :: Second ) , " " => Some ( TimeUnit :: MilliSecond ) , " " => Some ( TimeUnit :: MicroSecond ) , " " => Some ( TimeUnit :: NanoSecond ) , " " => Some ( TimeUnit :: PicoSecond ) , " " => Some ( TimeUnit :: FemtoSecond ) , _ => None , } } else { None } }
Try to parse the next text token as a time unit.
Try to parse the next text token as a time unit .
&mut self
&mut self