Let mutable userdata references in functions
This commit is contained in:
parent
044b08a10e
commit
bb692951db
|
@ -288,3 +288,10 @@ impl<'a, T: Userdata> FromLua<'a> for &'a T {
|
||||||
ud.as_ref::<T>()
|
ud.as_ref::<T>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, T: Userdata> FromLua<'a> for &'a mut T {
|
||||||
|
fn from_lua(_lua: &'a State, val: Value<'a>) -> crate::Result<Self> {
|
||||||
|
let ud = val.into_userdata()?;
|
||||||
|
ud.as_mut::<T>()
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue