Skip to content

Commit 9d6f881

Browse files
fix(rust): edition matching logic (#785)
1 parent c64cc75 commit 9d6f881

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/conform/util.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ M.parse_rust_edition = function(dir)
194194
for _, manifest in ipairs(manifest_files) do
195195
for line in io.lines(manifest) do
196196
-- if a project is part of a workspace, the edition might be defined top-level
197-
local is_in_workspace = line:match("edition *= *{ *workspace *= *true *}")
198-
or line:match("edition.workspace *= *true")
199-
local edition = line:match("^edition *= *(%d+)")
197+
local is_in_workspace = line:match("^edition *= *{ *workspace *= *true *}")
198+
or line:match("^edition.workspace *= *true")
199+
local edition = line:match('^edition *= *"(%d+)"')
200200
if is_in_workspace then
201201
break
202202
elseif edition then

0 commit comments

Comments
 (0)