We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
collect_garbage
1 parent c1a018a commit 1cb081dCopy full SHA for 1cb081d
src/state.rs
@@ -49,7 +49,6 @@ pub use raw::RawLua;
49
use util::{callback_error_ext, StateGuard};
50
51
/// Top level Lua struct which represents an instance of Lua VM.
52
-#[derive(Clone)]
53
pub struct Lua {
54
pub(self) raw: XRc<ReentrantMutex<RawLua>>,
55
// Controls whether garbage collection should be run on drop
@@ -151,6 +150,16 @@ impl Drop for Lua {
151
150
}
152
153
+impl Clone for Lua {
154
+ #[inline]
155
+ fn clone(&self) -> Self {
156
+ Lua {
157
+ raw: XRc::clone(&self.raw),
158
+ collect_garbage: false,
159
+ }
160
161
+}
162
+
163
impl fmt::Debug for Lua {
164
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
165
write!(f, "Lua({:p})", self.lock().state())
0 commit comments