diff --git a/src/function.rs b/src/function.rs index 3a0aa36..13d1efb 100644 --- a/src/function.rs +++ b/src/function.rs @@ -38,8 +38,8 @@ pub struct OwnedFunction(pub(crate) crate::types::LuaOwnedRef); #[cfg(feature = "unstable")] impl OwnedFunction { /// Get borrowed handle to the underlying Lua function. - pub const fn to_ref(&self) -> Function { - Function(self.0.to_ref()) + pub const fn as_ref(&self) -> Function { + Function(self.0.as_ref()) } } diff --git a/src/table.rs b/src/table.rs index 709bf16..3da613c 100644 --- a/src/table.rs +++ b/src/table.rs @@ -31,8 +31,8 @@ pub struct OwnedTable(pub(crate) crate::types::LuaOwnedRef); #[cfg(feature = "unstable")] impl OwnedTable { /// Get borrowed handle to the underlying Lua table. - pub const fn to_ref(&self) -> Table { - Table(self.0.to_ref()) + pub const fn as_ref(&self) -> Table { + Table(self.0.as_ref()) } } diff --git a/src/types.rs b/src/types.rs index 47bd9db..1e81ea0 100644 --- a/src/types.rs +++ b/src/types.rs @@ -253,7 +253,7 @@ impl fmt::Debug for LuaOwnedRef { #[cfg(feature = "unstable")] impl Clone for LuaOwnedRef { fn clone(&self) -> Self { - self.to_ref().clone().into_owned() + self.as_ref().clone().into_owned() } } @@ -282,7 +282,7 @@ impl LuaOwnedRef { } } - pub(crate) const fn to_ref(&self) -> LuaRef { + pub(crate) const fn as_ref(&self) -> LuaRef { LuaRef { lua: &self.lua, index: self.index, diff --git a/src/userdata.rs b/src/userdata.rs index e43d52f..e524a19 100644 --- a/src/userdata.rs +++ b/src/userdata.rs @@ -747,8 +747,8 @@ pub struct OwnedAnyUserData(pub(crate) crate::types::LuaOwnedRef); #[cfg(feature = "unstable")] impl OwnedAnyUserData { - pub const fn to_ref(&self) -> AnyUserData { - AnyUserData(self.0.to_ref()) + pub const fn as_ref(&self) -> AnyUserData { + AnyUserData(self.0.as_ref()) } }