Skip to content
Myr

mod.rs

This file

Path

src/parameter/mod.rs

23 lines · 579 bytes · Rust

Last changed by

style: simplify string interpolationHamir Mahalbefore adoptionef12632

History of this file

Take it

1use crate::util::number::Number;2use std::fmt::Display;34pub mod range_step;5pub mod tokenize;67#[derive(Debug, Clone, PartialEq, Eq)]8pub enum ParameterValue {9    Text(String),10    Numeric(Number),11}1213impl Display for ParameterValue {14    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {15        let str = match self {16            ParameterValue::Text(ref value) => value.clone(),17            ParameterValue::Numeric(value) => value.to_string(),18        };19        write!(f, "{str}")20    }21}2223pub type ParameterNameAndValue<'a> = (&'a str, ParameterValue);