Files
hyperfine/src/parameter/mod.rs
T
one230six c0921351e7 refactor: Optimize code based on cargo clippy suggestions
Signed-off-by: one230six <723682061@qq.com>

refactor: Optimize code based on cargo clippy suggestions

Signed-off-by: one230six <723682061@qq.com>
2024-03-14 08:46:35 +01:00

24 lines
581 B
Rust

use crate::util::number::Number;
use std::fmt::Display;
pub mod range_step;
pub mod tokenize;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ParameterValue {
Text(String),
Numeric(Number),
}
impl Display for ParameterValue {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let str = match self {
ParameterValue::Text(ref value) => value.clone(),
ParameterValue::Numeric(value) => value.to_string(),
};
write!(f, "{}", str)
}
}
pub type ParameterNameAndValue<'a> = (&'a str, ParameterValue);