mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 18:44:12 +02:00
project critical
This commit is contained in:
parent
306362d36e
commit
331a9fe593
4 changed files with 127 additions and 50 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue