Fix test Vec2 compile error
ci/woodpecker/push/debug Pipeline was successful Details

This commit is contained in:
SeanOMik 2024-02-12 20:35:17 -05:00
parent 8aec55c2d6
commit 5694d395ab
Signed by: SeanOMik
GPG Key ID: FEC9E2FC15235964
1 changed files with 2 additions and 2 deletions

View File

@ -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 }))