Skip to content

Commit

Permalink
Remove unreachable code branches
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
  • Loading branch information
Rustin170506 committed Nov 3, 2022
1 parent ce3f722 commit 61fe73e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/cargo/ops/cargo_add/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,7 @@ fn infer_package_for_git_source(
src: &dyn std::fmt::Display,
) -> CargoResult<Package> {
let package = match packages.len() {
0 => {
anyhow::bail!("no packages found at `{src}`");
}
0 => unreachable!(),
1 => packages.pop().expect("match ensured element is present"),
_ => {
let mut names: Vec<_> = packages
Expand Down

0 comments on commit 61fe73e

Please sign in to comment.