Fix test Vec2 compile error
ci/woodpecker/push/debug Pipeline was successful
Details
ci/woodpecker/push/debug Pipeline was successful
Details
This commit is contained in:
parent
8aec55c2d6
commit
5694d395ab
|
@ -10,8 +10,8 @@ pub struct Vec2 {
|
||||||
impl Userdata for Vec2 {
|
impl Userdata for Vec2 {
|
||||||
fn build<'a>(_state: &State, builder: &mut UserdataBuilder<'a, Vec2>) -> crate::Result<()> {
|
fn build<'a>(_state: &State, builder: &mut UserdataBuilder<'a, Vec2>) -> crate::Result<()> {
|
||||||
builder
|
builder
|
||||||
.field_getter("x", |_, this| Ok(this.x))
|
.field_getter("x", |_, this| this.x)
|
||||||
.field_getter("y", |_, this| Ok(this.y))
|
.field_getter("y", |_, this| this.y)
|
||||||
.field_setter("x", |_, this, x: f32| this.x = x)
|
.field_setter("x", |_, this, x: f32| this.x = x)
|
||||||
.field_setter("y", |_, this, y: f32| this.y = y)
|
.field_setter("y", |_, this, y: f32| this.y = y)
|
||||||
.function("new", |lua, (x, y)| lua.create_userdata(Vec2 { x, y }))
|
.function("new", |lua, (x, y)| lua.create_userdata(Vec2 { x, y }))
|
||||||
|
|
Loading…
Reference in New Issue