perf: Do not instantiate Id::from(&&str)

Saves 0.3K.
This commit is contained in:
Jan Verbeek 2022-02-01 01:14:44 +01:00
parent 9e625c0c55
commit bfc8e8d367
2 changed files with 2 additions and 2 deletions

View file

@ -4335,7 +4335,7 @@ impl<'help> Arg<'help> {
/// [`Arg::exclusive(true)`]: Arg::exclusive()
#[must_use]
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
}

View file

@ -124,7 +124,7 @@ impl<'help> ArgGroup<'help> {
#[must_use]
pub fn name<S: Into<&'help str>>(mut self, n: S) -> Self {
self.name = n.into();
self.id = Id::from(&self.name);
self.id = Id::from(self.name);
self
}