From 5f2c6c0c833734914080ae061e2a7d44bc606180 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Wed, 13 Sep 2023 10:53:03 +0100 Subject: refactor: pull out predicate function --- lua/nvim-treesitter/install.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'lua') diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 44e7e048f..b6e3c3de3 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -145,18 +145,16 @@ local function get_compile_location(repo, cache_dir, project_name, from_local_pa return fs.joinpath(cache_dir, repo_location) end +local function istring(c) + return type(c) == 'string' +end + local function cc_err() - log.error('No C compiler found! "' .. table.concat( - vim.iter.filter( - ---@param c string - ---@return boolean - function(c) - return type(c) == 'string' - end, - M.compilers - ), - '", "' - ) .. '" are not executable.') + log.error( + 'No C compiler found! "' + .. table.concat(vim.iter.filter(istring, M.compilers), '", "') + .. '" are not executable.' + ) end --- @param x string -- cgit v1.2.3-70-g09d2