Skip to content

Commit

Permalink
refactor: Simplify Arg::new
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Dec 7, 2021
1 parent cf3a900 commit 8d688b4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/build/arg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,7 @@ impl<'help> Arg<'help> {
/// ```
/// [`Arg::takes_value(true)`]: Arg::takes_value()
pub fn new<S: Into<&'help str>>(n: S) -> Self {
let name = n.into();
Arg {
id: Id::from(&*name),
name,
..Default::default()
}
Arg::default().name(n)
}

/// Set the identifier used for referencing this argument in the clap API.
Expand Down

0 comments on commit 8d688b4

Please sign in to comment.