Skip to content

Commit

Permalink
fix(builder)!: Move remove to reflection from builder
Browse files Browse the repository at this point in the history
It isn't derive compatible, so I have the feeling it should be treated
differently.
  • Loading branch information
epage committed Aug 9, 2024
1 parent fba563a commit 7d14ce3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions clap_builder/src/builder/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,6 @@ impl Arg {
self.ext.set(tagged);
self
}

/// Remove an [`ArgExt`]
#[cfg(feature = "unstable-ext")]
pub fn remove<T: ArgExt + Extension>(mut self) -> Self {
self.ext.remove::<T>();
self
}
}

/// # Value Handling
Expand Down Expand Up @@ -4240,6 +4233,12 @@ impl Arg {
pub fn get<T: ArgExt + Extension>(&self) -> Option<&T> {
self.ext.get::<T>()
}

/// Remove an [`ArgExt`]
#[cfg(feature = "unstable-ext")]
pub fn remove<T: ArgExt + Extension>(mut self) -> Option<T> {
self.ext.remove::<T>()
}
}

/// # Internally used only
Expand Down

0 comments on commit 7d14ce3

Please sign in to comment.