Skip to content

Commit b312995

Browse files
committed
More cleanup
1 parent b4dce6f commit b312995

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

lua/aoc/api.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ M.user_agent = "<github.com/csessh/aoc.nvim> by csessh@hey.com"
1212
---@param year string|osdate
1313
local validate_args = function(day, year)
1414
if day == nil or day == "" then
15-
vim.api.nvim_err_writeln "Missing day"
15+
vim.api.nvim_err_writeln "Day is not valid or is not specified"
1616
return false
1717
end
1818

1919
if year == nil or year == "" then
20-
vim.api.nvim_err_writeln "Missing year"
20+
vim.api.nvim_err_writeln "Year is not valid of is not specified"
2121
return false
2222
end
2323

lua/aoc/cache.lua

+1-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,7 @@ end
2525
---@param year string|osdate
2626
---@return file*?
2727
M.get_cached_input_file = function(day, year)
28-
local f = io.open(cache_path .. year .. day .. ".txt")
29-
30-
if not f then
31-
return nil
32-
end
33-
34-
return f
28+
return io.open(cache_path .. year .. day .. ".txt")
3529
end
3630

3731
---Write cached content to file

0 commit comments

Comments
 (0)