Add missing usize conversion

This commit is contained in:
David Wendt 2019-10-22 09:05:40 -04:00
parent fb34f73159
commit 207a157f20
1 changed files with 6 additions and 0 deletions

View File

@ -68,6 +68,12 @@ impl<'gc> From<u32> for Value<'gc> {
} }
} }
impl<'gc> From<usize> for Value<'gc> {
fn from(value: usize) -> Self {
Value::Number(value as f64)
}
}
unsafe impl<'gc> gc_arena::Collect for Value<'gc> { unsafe impl<'gc> gc_arena::Collect for Value<'gc> {
fn trace(&self, cc: gc_arena::CollectionContext) { fn trace(&self, cc: gc_arena::CollectionContext) {
if let Value::Object(object) = self { if let Value::Object(object) = self {