Skip to content

Commit

Permalink
avoid panic when no match on downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelemusiani committed Sep 13, 2024
1 parent c8a01bc commit 524f490
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ pub fn downgrade(package: String, version: Option<String>) -> Result<String> {
err.push('\n');

return Err(err.into());
} else if pkg.len() == 0 {
return Err("No package matched pattern\n".into());
}

println!("Matched package {}. Downgrading...", pkg[0].green());
Expand Down

0 comments on commit 524f490

Please sign in to comment.