Optimize ObjectLike::to_string for tables and userdata

This commit is contained in:
Alex Orlenko
2024-08-30 22:55:53 +01:00
parent 4018a17e26
commit d6b27de34e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -941,7 +941,7 @@ impl ObjectLike for Table {
#[inline]
fn to_string(&self) -> Result<StdString> {
Value::Table(self.clone()).to_string()
Value::Table(Table(self.0.copy())).to_string()
}
}
+1 -1
View File
@@ -88,6 +88,6 @@ impl ObjectLike for AnyUserData {
#[inline]
fn to_string(&self) -> Result<StdString> {
Value::UserData(self.clone()).to_string()
Value::UserData(AnyUserData(self.0.copy(), self.1)).to_string()
}
}