From f66932e8d2f6cc49ec71cd27a05693ed9ef2dfbd Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Thu, 30 Mar 2023 22:35:43 +0100 Subject: [PATCH] Revert "Rename `Owned*::to_ref()` to `as_ref()`" This reverts commit 5394faca161c969208defbd953a2bfb7690cac7c. --- src/function.rs | 4 ++-- src/table.rs | 4 ++-- src/types.rs | 4 ++-- src/userdata.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/function.rs b/src/function.rs index 92a78eb..ccd1949 100644 --- a/src/function.rs +++ b/src/function.rs @@ -39,8 +39,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 as_ref(&self) -> Function { - Function(self.0.as_ref()) + pub const fn to_ref(&self) -> Function { + Function(self.0.to_ref()) } } diff --git a/src/table.rs b/src/table.rs index 6aab63f..5231a06 100644 --- a/src/table.rs +++ b/src/table.rs @@ -32,8 +32,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 as_ref(&self) -> Table { - Table(self.0.as_ref()) + pub const fn to_ref(&self) -> Table { + Table(self.0.to_ref()) } } diff --git a/src/types.rs b/src/types.rs index a0bf8e6..8a3e34c 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.as_ref().clone().into_owned() + self.to_ref().clone().into_owned() } } @@ -282,7 +282,7 @@ impl LuaOwnedRef { } } - pub(crate) const fn as_ref(&self) -> LuaRef { + pub(crate) const fn to_ref(&self) -> LuaRef { LuaRef { lua: &self.lua, index: self.index, diff --git a/src/userdata.rs b/src/userdata.rs index e524a19..e43d52f 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 as_ref(&self) -> AnyUserData { - AnyUserData(self.0.as_ref()) + pub const fn to_ref(&self) -> AnyUserData { + AnyUserData(self.0.to_ref()) } }