From e1bbd00a33df327fa3aa04e8f579baef5e31150c Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Fri, 28 Oct 2022 10:43:05 +0100 Subject: Fix getting caller information from Lua::load --- src/lua.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lua.rs b/src/lua.rs index 65c1278..38d7c42 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -1371,9 +1371,8 @@ impl Lua { where S: AsChunk<'lua> + ?Sized, { - let name = chunk - .name() - .unwrap_or_else(|| Location::caller().to_string()); + let caller = Location::caller(); + let name = chunk.name().unwrap_or_else(|| caller.to_string()); Chunk { lua: self, -- cgit v1.2.3