refactor: pull out predicate function

This commit is contained in:
Lewis Russell 2023-09-13 10:53:03 +01:00 committed by Christian Clason
parent 59f5d64a61
commit 5f2c6c0c83

View file

@ -145,18 +145,16 @@ local function get_compile_location(repo, cache_dir, project_name, from_local_pa
return fs.joinpath(cache_dir, repo_location) return fs.joinpath(cache_dir, repo_location)
end end
local function istring(c)
return type(c) == 'string'
end
local function cc_err() local function cc_err()
log.error('No C compiler found! "' .. table.concat( log.error(
vim.iter.filter( 'No C compiler found! "'
---@param c string .. table.concat(vim.iter.filter(istring, M.compilers), '", "')
---@return boolean .. '" are not executable.'
function(c) )
return type(c) == 'string'
end,
M.compilers
),
'", "'
) .. '" are not executable.')
end end
--- @param x string --- @param x string