Skip to content

Commit 7cebd8c

Browse files
author
Pi-Cla
committed
Add ValueEnum derivation to OwnerLevel
Needed to actually parse OwnerLevel with Clap
1 parent 9eeaf71 commit 7cebd8c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ pubgrub = "0.2"
4040
http-auth-basic = "0.3"
4141
# base16 encoding
4242
base16 = { version = "0.2", features = ["alloc"] }
43+
# Implement ValueEnum for OwnerLevel type
44+
clap = { version = "4", features = ["derive"] }
4345

4446
[dev-dependencies]
4547
# HTTP client

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ pub fn revert_release_response(response: http::Response<Vec<u8>>) -> Result<(),
544544
}
545545

546546
/// See: https://github.com/hexpm/hex/blob/main/lib/mix/tasks/hex.owner.ex#L47
547-
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
547+
#[derive(Debug, Clone, Copy, clap::ValueEnum, PartialEq, Eq, PartialOrd, Ord)]
548548
pub enum OwnerLevel {
549549
/// Has every package permission EXCEPT the ability to change who owns the package
550550
Maintainer,

0 commit comments

Comments
 (0)