Skip to content

Commit

Permalink
Get rid of our custom typeof shim, thanks mlua
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Oct 4, 2023
1 parent 462e9a4 commit e485066
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 74 deletions.
2 changes: 0 additions & 2 deletions src/lune/globals/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use super::util::TableBuilder;
mod g_table;
mod print;
mod require;
mod r#typeof;
mod version;
mod warn;

Expand All @@ -15,7 +14,6 @@ pub fn inject_all(lua: &'static Lua) -> LuaResult<()> {
.with_value("_VERSION", version::create(lua)?)?
.with_value("print", print::create(lua)?)?
.with_value("require", require::create(lua)?)?
.with_value("typeof", r#typeof::create(lua)?)?
.with_value("warn", warn::create(lua)?)?
.build_readonly()?;

Expand Down
27 changes: 0 additions & 27 deletions src/lune/globals/typeof.rs

This file was deleted.

45 changes: 0 additions & 45 deletions src/roblox/datatypes/extension.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
use mlua::prelude::*;

use crate::roblox::instance::Instance;

use super::*;

pub(crate) trait DomValueExt {
Expand Down Expand Up @@ -59,44 +55,3 @@ impl DomValueExt for DomValue {
self.ty().variant_name()
}
}

pub trait RobloxUserdataTypenameExt {
fn roblox_type_name(&self) -> Option<&'static str>;
}

impl<'lua> RobloxUserdataTypenameExt for LuaAnyUserData<'lua> {
#[rustfmt::skip]
fn roblox_type_name(&self) -> Option<&'static str> {
use super::types::*;

Some(match self {
value if value.is::<Axes>() => "Axes",
value if value.is::<BrickColor>() => "BrickColor",
value if value.is::<CFrame>() => "CFrame",
value if value.is::<Color3>() => "Color3",
value if value.is::<ColorSequence>() => "ColorSequence",
value if value.is::<ColorSequenceKeypoint>() => "ColorSequenceKeypoint",
value if value.is::<Enums>() => "Enums",
value if value.is::<Enum>() => "Enum",
value if value.is::<EnumItem>() => "EnumItem",
value if value.is::<Faces>() => "Faces",
value if value.is::<Font>() => "Font",
value if value.is::<Instance>() => "Instance",
value if value.is::<NumberRange>() => "NumberRange",
value if value.is::<NumberSequence>() => "NumberSequence",
value if value.is::<NumberSequenceKeypoint>() => "NumberSequenceKeypoint",
value if value.is::<PhysicalProperties>() => "PhysicalProperties",
value if value.is::<Ray>() => "Ray",
value if value.is::<Rect>() => "Rect",
value if value.is::<Region3>() => "Region3",
value if value.is::<Region3int16>() => "Region3int16",
value if value.is::<UDim>() => "UDim",
value if value.is::<UDim2>() => "UDim2",
value if value.is::<Vector2>() => "Vector2",
value if value.is::<Vector2int16>() => "Vector2int16",
value if value.is::<Vector3>() => "Vector3",
value if value.is::<Vector3int16>() => "Vector3int16",
_ => return None,
})
}
}

0 comments on commit e485066

Please sign in to comment.