Skip to content

Commit 9eac2f4

Browse files
committed
refactor: rename misleading variables
1 parent 96c4e29 commit 9eac2f4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: lua/crates/actions.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ function M.open_homepage()
114114
local crates = util.get_line_crates(buf, Span.pos(line))
115115
local _, crate = next(crates)
116116
if crate then
117-
local crate_info = state.api_cache[crate:package()]
118-
if crate_info and crate_info.homepage then
119-
util.open_url(crate_info.homepage)
117+
local api_crate = state.api_cache[crate:package()]
118+
if api_crate and api_crate.homepage then
119+
util.open_url(api_crate.homepage)
120120
else
121121
util.notify(vim.log.levels.INFO, "The crate '%s' has no homepage specified", crate:package())
122122
end
@@ -129,9 +129,9 @@ function M.open_repository()
129129
local crates = util.get_line_crates(buf, Span.pos(line))
130130
local _, crate = next(crates)
131131
if crate then
132-
local crate_info = state.api_cache[crate:package()]
133-
if crate_info and crate_info.repository then
134-
util.open_url(crate_info.repository)
132+
local api_crate = state.api_cache[crate:package()]
133+
if api_crate and api_crate.repository then
134+
util.open_url(api_crate.repository)
135135
else
136136
util.notify(vim.log.levels.INFO, "The crate '%s' has no repository specified", crate:package())
137137
end
@@ -144,8 +144,8 @@ function M.open_documentation()
144144
local crates = util.get_line_crates(buf, Span.pos(line))
145145
local _, crate = next(crates)
146146
if crate then
147-
local crate_info = state.api_cache[crate:package()]
148-
local url = crate_info and crate_info.documentation
147+
local api_crate = state.api_cache[crate:package()]
148+
local url = api_crate and api_crate.documentation
149149
url = url or util.docs_rs_url(crate:package())
150150
util.open_url(url)
151151
end

0 commit comments

Comments
 (0)