Skip to content

Commit 4a7d1f6

Browse files
committed
refactor: remove redundant conditional
Already checked above, and `return`-ed if failed.
1 parent 698c6aa commit 4a7d1f6

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lua/wincent/commandt/health.lua

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,13 @@ local check_ruby_c_extension = function()
6363

6464
if vim.fn.exists(':CommandTLoad') ~= 0 then
6565
vim.cmd('CommandTLoad')
66-
if vim.fn.has('ruby') == 1 then
67-
local result = vim.fn.rubyeval('$command_t && $command_t.class.respond_to?(:guard) ? 1 : 0')
68-
if result == 1 then
69-
health.ok('Has working Ruby C extension')
70-
else
71-
health.warn('Ruby C extension missing or broken', {
72-
'Try running `ruby extconf.rb && make` from\n' .. ruby_build_directory,
73-
})
74-
end
66+
local result = vim.fn.rubyeval('$command_t && $command_t.class.respond_to?(:guard) ? 1 : 0')
67+
if result == 1 then
68+
health.ok('Has working Ruby C extension')
69+
else
70+
health.warn('Ruby C extension missing or broken', {
71+
'Try running `ruby extconf.rb && make` from\n' .. ruby_build_directory,
72+
})
7573
end
7674
else
7775
health.warn(':CommandTLoad does not exist')

0 commit comments

Comments
 (0)