Skip to main content

convert_lit_to_number

Function convert_lit_to_number 

Source
pub fn convert_lit_to_number(lit_num: &Lit) -> Result<f64, Error>
Expand description

Helper function to convert a Lit to a number

§Arguments

  • lit_num - The literal to convert

§Returns

  • Result<f64, anyhow::Error> - The number value of the literal

§Example

Input: Lit::Num(1.0)
Output: 1.0