mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
perf: Do not instantiate Id::from(&&str)
Saves 0.3K.
This commit is contained in:
parent
9e625c0c55
commit
bfc8e8d367
2 changed files with 2 additions and 2 deletions
|
@ -4335,7 +4335,7 @@ impl<'help> Arg<'help> {
|
||||||
/// [`Arg::exclusive(true)`]: Arg::exclusive()
|
/// [`Arg::exclusive(true)`]: Arg::exclusive()
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn conflicts_with_all(mut self, names: &[&str]) -> Self {
|
pub fn conflicts_with_all(mut self, names: &[&str]) -> Self {
|
||||||
self.blacklist.extend(names.iter().map(Id::from));
|
self.blacklist.extend(names.iter().copied().map(Id::from));
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ impl<'help> ArgGroup<'help> {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn name<S: Into<&'help str>>(mut self, n: S) -> Self {
|
pub fn name<S: Into<&'help str>>(mut self, n: S) -> Self {
|
||||||
self.name = n.into();
|
self.name = n.into();
|
||||||
self.id = Id::from(&self.name);
|
self.id = Id::from(self.name);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue