summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2022-10-28 10:43:05 +0100
committerAlex Orlenko <zxteam@protonmail.com>2022-10-28 10:43:05 +0100
commite1bbd00a33df327fa3aa04e8f579baef5e31150c (patch)
tree4788f8dc2af3fa53907f5a7243800ac45e0b8a74 /src
parente98998d6ac8dc51de8c648d2a6a461121769d293 (diff)
downloadmlua-e1bbd00a33df327fa3aa04e8f579baef5e31150c.zip
Fix getting caller information from Lua::load
Diffstat (limited to 'src')
-rw-r--r--src/lua.rs5
1 files changed, 2 insertions, 3 deletions
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,