]> git.proxmox.com Git - cargo.git/commit - src/bin/cargo/commands/uninstall.rs
Auto merge of #10753 - epage:clap32-deprecated, r=weihanglo
authorbors <bors@rust-lang.org>
Tue, 14 Jun 2022 23:11:47 +0000 (23:11 +0000)
committerbors <bors@rust-lang.org>
Tue, 14 Jun 2022 23:11:47 +0000 (23:11 +0000)
commit17f8088d6eafd82349630a8de8cc6efe03abf5fb
treea6d2176c396f984f76b355d349d175eea1e66ec2
parent6b8e1922261bbed1894bf40069fb2d5dc8d62fb0
parentfc0ca1e17897f7038907b8ab9532c36da4db97e9
Auto merge of #10753 - epage:clap32-deprecated, r=weihanglo

chore: Upgrade to clap 3.2

I decided to use cargo as a test case for upgrading to clap 3.2 prior to release.  From the builder API's perspective, a lot has change.  While the changelog summarizes it, the release announcement is still pending.  In short, the API is now typed.  You declare what type an `Arg` is and access it by that type.  flags (both `is_present` and `occurrences_of`) are also now specified through `ArgAction` and the result gets stored like any other arg value.  I made a `ArgMatchesExt::flag` and `command_prelude::flag` functions to make working with these easier.

Now that clap exposes non-panicking variants of its functions, I switched from a "look before you leap" approach with `is_arg_valid` to a "better to ask forgiveness than permission" with checking the error variant.  I decided to just make a convenience to swallow that error type.  Not a fan of how loose things are but I think this will just be something we iterate on over time.