Let mutable userdata references in functions
This commit is contained in:
parent
044b08a10e
commit
bb692951db
|
@ -287,4 +287,11 @@ impl<'a, T: Userdata> FromLua<'a> for &'a T {
|
||||||
let ud = val.into_userdata()?;
|
let ud = val.into_userdata()?;
|
||||||
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