1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-04 18:44:12 +02:00

project critical

This commit is contained in:
Robin Appelman 2025-06-26 16:56:04 +02:00
commit 331a9fe593
4 changed files with 127 additions and 50 deletions

View file

@ -1039,6 +1039,19 @@ impl TryFrom<&SendPropValue> for i64 {
}
}
impl TryFrom<&SendPropValue> for bool {
type Error = MalformedSendPropDefinitionError;
fn try_from(value: &SendPropValue) -> std::result::Result<Self, Self::Error> {
match value {
SendPropValue::Integer(val) => Ok(*val > 0),
_ => Err(MalformedSendPropDefinitionError::WrongPropType {
expected: "boolean",
value: value.clone(),
}),
}
}
}
impl TryFrom<&SendPropValue> for Vector {
type Error = MalformedSendPropDefinitionError;
fn try_from(value: &SendPropValue) -> std::result::Result<Self, Self::Error> {