From 0116d405b24ecf37c3bc6953518a97bec1e9c499 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Tue, 12 Mar 2024 23:19:21 +0100 Subject: [PATCH] Fix globals being injected multiple times in repl --- src/lune/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lune/mod.rs b/src/lune/mod.rs index aa2b4b8..ce676bf 100644 --- a/src/lune/mod.rs +++ b/src/lune/mod.rs @@ -35,6 +35,8 @@ impl Runtime { lua.set_app_data(Rc::downgrade(&lua)); lua.set_app_data(Vec::::new()); + globals::inject_all(&lua).expect("Failed to inject globals"); + Self { lua, args: Vec::new(), @@ -65,7 +67,6 @@ impl Runtime { ) -> Result { // Create a new scheduler for this run let sched = Scheduler::new(&self.lua); - globals::inject_all(&self.lua)?; // Add error callback to format errors nicely + store status let got_any_error = Arc::new(AtomicBool::new(false));