Revert "Rename `Owned*::to_ref()` to `as_ref()`"

This reverts commit 5394faca16.
This commit is contained in:
Alex Orlenko 2023-03-30 22:35:43 +01:00
parent da6d5a93c9
commit f66932e8d2
No known key found for this signature in database
GPG Key ID: 4C150C250863B96D
4 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

@ -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,

View File

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