mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
Optimize ObjectLike::to_string for tables and userdata
This commit is contained in:
+1
-1
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user