Skip to content

Commit 21f67b9

Browse files
authored
fix(async): remove deprecated "vim.validate" (#276)
1 parent 5d448b1 commit 21f67b9

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

lua/gitlinker/async.lua

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ end
5555
--- @tparam any ... Arguments for func
5656
--- @treturn async_t Handle
5757
function M.run(func, callback, ...)
58-
vim.validate({
59-
func = { func, "function" },
60-
callback = { callback, "function", true },
61-
})
6258
local co = coroutine.create(func)
6359
local handle = Async_T.new(co)
6460
local function step(...)
@@ -89,10 +85,6 @@ function M.run(func, callback, ...)
8985
return handle
9086
end
9187
local function wait(argc, func, ...)
92-
vim.validate({
93-
argc = { argc, "number" },
94-
func = { func, "function" },
95-
})
9688
-- Always run the wrapped functions in xpcall and re-raise the error in the
9789
-- coroutine. This makes pcall work as normal.
9890
local function pfunc(...)
@@ -133,10 +125,6 @@ end
133125
--- @tparam boolean strict Error when called in non-async context
134126
--- @treturn function(...):async_t
135127
function M.create(func, argc, strict)
136-
vim.validate({
137-
func = { func, "function" },
138-
argc = { argc, "number", true },
139-
})
140128
argc = argc or 0
141129
return function(...)
142130
if M.running() then
@@ -154,7 +142,6 @@ end
154142
--- @tparam function func
155143
--- @tparam boolean strict Error when called in non-async context
156144
function M.void(func, strict)
157-
vim.validate({ func = { func, "function" } })
158145
return function(...)
159146
if M.running() then
160147
if strict then
@@ -172,9 +159,6 @@ end
172159
--- @tparam boolean strict Error when called in non-async context
173160
--- @treturn function Returns an async function
174161
function M.wrap(func, argc, strict)
175-
vim.validate({
176-
argc = { argc, "number" },
177-
})
178162
return function(...)
179163
if not M.running() then
180164
if strict then

0 commit comments

Comments
 (0)