Make the Value non_exhaustive

This commit is contained in:
Olivier Goffart 2021-03-15 12:07:52 +01:00
parent a203097b88
commit 5a416d0fc7
2 changed files with 3 additions and 6 deletions

View file

@ -286,11 +286,7 @@ fn to_js_value<'cx>(
&format!("#{:02x}{:02x}{:02x}{:02x}", c.red(), c.green(), c.blue(), c.alpha()),
)
.as_value(cx),
Value::Brush(_)
| Value::PathElements(_)
| Value::EasingCurve(_)
| Value::EnumerationValue(..)
| Value::Model(_) => todo!("converting {:?} to js has not been implemented", val),
_ => todo!("converting {:?} to js has not been implemented", val),
})
}

View file

@ -101,9 +101,10 @@ impl PartialEq for ModelPtr {
}
}
#[derive(Clone, PartialEq, Debug)]
/// This is a dynamically typed Value used in the interpreter, it need to be able
/// to be converted from and to anything that can be stored in a Property
#[derive(Clone, PartialEq, Debug)]
#[non_exhaustive]
pub enum Value {
/// There is nothing in this value. That's the default.
/// For example, a function that do not return a result would return a Value::Void