speedrun_api/types/
variable_impls.rs

1use std::fmt::Display;
2
3use crate::api::variables::VariableId;
4
5use super::{Value, Variable};
6
7impl<'a> From<Variable<'a>> for VariableId<'a> {
8    fn from(value: Variable<'a>) -> Self {
9        value.id
10    }
11}
12
13impl Display for Variable<'_> {
14    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15        write!(f, "{}", &self.name)
16    }
17}
18
19impl Display for Value {
20    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21        write!(f, "{}", &self.label)
22    }
23}