Skip to content

Commit cc7fcaf

Browse files
committed
refactor(toml): move git and patch conflict to separate match arm
1 parent 3505b05 commit cc7fcaf

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/cargo/util/toml/mod.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,15 +1910,14 @@ fn to_dependency_source_id<P: ResolveToPath + Clone>(
19101910
Only one of `registry` or `registry-index` is allowed.",
19111911
name_in_toml
19121912
),
1913-
(Some(git), maybe_path, _, _) => {
1914-
if maybe_path.is_some() {
1915-
bail!(
1916-
"dependency ({}) specification is ambiguous. \
1917-
Only one of `git` or `path` is allowed.",
1918-
name_in_toml
1919-
);
1920-
}
1921-
1913+
(Some(_git), Some(_path), _, _) => {
1914+
bail!(
1915+
"dependency ({}) specification is ambiguous. \
1916+
Only one of `git` or `path` is allowed.",
1917+
name_in_toml
1918+
);
1919+
}
1920+
(Some(git), None, _, _) => {
19221921
let n_details = [&orig.branch, &orig.tag, &orig.rev]
19231922
.iter()
19241923
.filter(|d| d.is_some())

0 commit comments

Comments
 (0)