Skip to content

Commit

Permalink
Add REQWEST_VERSION global
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamVenner committed Jan 20, 2022
1 parent ae8676b commit 7332d92
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mod blocking;

unsafe extern "C-unwind" fn request(lua: gmod::lua::State) -> i32 {
// lua_run require("reqwest") reqwest({ url = "https://google.com", success = function(...) PrintTable({...}) end, failed = function(...) PrintTable({...}) end })
// lua_run require("reqwest") PrintTable({reqwest({ blocking = true, url = "https://google.com", success = function(...) PrintTable({...}) end, failed = function(...) PrintTable({...}) end })})

if lua.lua_type(1) != gmod::lua::LUA_TTABLE {
return 0;
Expand Down Expand Up @@ -42,6 +43,9 @@ unsafe fn gmod13_open(lua: gmod::lua::State) -> i32 {
lua.push_function(request);
lua.set_global(lua_string!("reqwest"));

lua.push_string(env!("CARGO_PKG_VERSION"));
lua.set_global(lua_string!("REQWEST_VERSION"));

0
}

Expand Down

0 comments on commit 7332d92

Please sign in to comment.