mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
refactor: Simplify Arg::new
This commit is contained in:
parent
55186f5aa3
commit
c1033a3d7a
1 changed files with 1 additions and 6 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue