mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
chore: Remove the TODO chaff
The intent is to make stand out more the important technical debt hidden in comments.
This commit is contained in:
parent
90d4a3ca73
commit
895e85714b
6 changed files with 1 additions and 16 deletions
|
@ -127,7 +127,6 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
// @TODO @p6 @internal: Reorder alphabetically
|
||||
impl_settings! { ArgSettings, ArgFlags,
|
||||
Required => Flags::REQUIRED,
|
||||
MultipleOccurrences => Flags::MULTIPLE_OCC,
|
||||
|
|
|
@ -98,7 +98,6 @@ pub trait Parser: FromArgMatches + IntoApp + Sized {
|
|||
fn parse_from<I, T>(itr: I) -> Self
|
||||
where
|
||||
I: IntoIterator<Item = T>,
|
||||
// TODO (@CreepySkeleton): discover a way to avoid cloning here
|
||||
T: Into<OsString> + Clone,
|
||||
{
|
||||
let matches = <Self as IntoApp>::into_app().get_matches_from(itr);
|
||||
|
@ -118,7 +117,6 @@ pub trait Parser: FromArgMatches + IntoApp + Sized {
|
|||
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
|
||||
where
|
||||
I: IntoIterator<Item = T>,
|
||||
// TODO (@CreepySkeleton): discover a way to avoid cloning here
|
||||
T: Into<OsString> + Clone,
|
||||
{
|
||||
let matches = <Self as IntoApp>::into_app().try_get_matches_from(itr)?;
|
||||
|
@ -129,10 +127,8 @@ pub trait Parser: FromArgMatches + IntoApp + Sized {
|
|||
fn update_from<I, T>(&mut self, itr: I)
|
||||
where
|
||||
I: IntoIterator<Item = T>,
|
||||
// TODO (@CreepySkeleton): discover a way to avoid cloning here
|
||||
T: Into<OsString> + Clone,
|
||||
{
|
||||
// TODO find a way to get partial matches
|
||||
let matches = <Self as IntoApp>::into_app_for_update().get_matches_from(itr);
|
||||
let res = <Self as FromArgMatches>::update_from_arg_matches(self, &matches)
|
||||
.map_err(format_error::<Self>);
|
||||
|
@ -147,7 +143,6 @@ pub trait Parser: FromArgMatches + IntoApp + Sized {
|
|||
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
|
||||
where
|
||||
I: IntoIterator<Item = T>,
|
||||
// TODO (@CreepySkeleton): discover a way to avoid cloning here
|
||||
T: Into<OsString> + Clone,
|
||||
{
|
||||
let matches = <Self as IntoApp>::into_app_for_update().try_get_matches_from(itr)?;
|
||||
|
@ -201,7 +196,6 @@ pub trait Parser: FromArgMatches + IntoApp + Sized {
|
|||
fn from_iter<I, T>(itr: I) -> Self
|
||||
where
|
||||
I: IntoIterator<Item = T>,
|
||||
// TODO (@CreepySkeleton): discover a way to avoid cloning here
|
||||
T: Into<OsString> + Clone,
|
||||
{
|
||||
Self::parse_from(itr)
|
||||
|
@ -216,7 +210,6 @@ pub trait Parser: FromArgMatches + IntoApp + Sized {
|
|||
fn from_iter_safe<I, T>(itr: I) -> Result<Self, Error>
|
||||
where
|
||||
I: IntoIterator<Item = T>,
|
||||
// TODO (@CreepySkeleton): discover a way to avoid cloning here
|
||||
T: Into<OsString> + Clone,
|
||||
{
|
||||
Self::try_parse_from(itr)
|
||||
|
@ -422,7 +415,6 @@ impl<T: Parser> Parser for Box<T> {
|
|||
fn parse_from<I, It>(itr: I) -> Self
|
||||
where
|
||||
I: IntoIterator<Item = It>,
|
||||
// TODO (@CreepySkeleton): discover a way to avoid cloning here
|
||||
It: Into<OsString> + Clone,
|
||||
{
|
||||
Box::new(<T as Parser>::parse_from(itr))
|
||||
|
@ -431,7 +423,6 @@ impl<T: Parser> Parser for Box<T> {
|
|||
fn try_parse_from<I, It>(itr: I) -> Result<Self, Error>
|
||||
where
|
||||
I: IntoIterator<Item = It>,
|
||||
// TODO (@CreepySkeleton): discover a way to avoid cloning here
|
||||
It: Into<OsString> + Clone,
|
||||
{
|
||||
<T as Parser>::try_parse_from(itr).map(Box::new)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
trivial_numeric_casts
|
||||
)]
|
||||
#![forbid(unsafe_code)]
|
||||
// TODO: https://github.com/rust-lang/rust-clippy/issues/7290
|
||||
// HACK https://github.com/rust-lang/rust-clippy/issues/7290
|
||||
#![allow(clippy::single_component_path_imports)]
|
||||
#![allow(clippy::branches_sharing_code)]
|
||||
|
||||
|
|
|
@ -362,8 +362,6 @@ impl<'help, 'app, 'parser> Usage<'help, 'app, 'parser> {
|
|||
// `incl_last`: should we include args that are Arg::Last? (i.e. `prog [foo] -- [last]). We
|
||||
// can't do that for required usages being built for subcommands because it would look like:
|
||||
// `prog [foo] -- [last] <subcommand>` which is totally wrong.
|
||||
// TODO: remove the allow clippy when we update the compiler version.
|
||||
#[allow(clippy::needless_collect)]
|
||||
pub(crate) fn get_required_usage_from(
|
||||
&self,
|
||||
incls: &[Id],
|
||||
|
|
|
@ -145,7 +145,6 @@ impl Default for MatchedArg {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: Maybe make this public?
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub(crate) enum ValueType {
|
||||
Unknown,
|
||||
|
|
|
@ -827,8 +827,6 @@ impl<'help, 'app> Parser<'help, 'app> {
|
|||
let mut bin_name = self.app.bin_name.as_ref().unwrap_or(&self.app.name).clone();
|
||||
|
||||
let mut sc = {
|
||||
// @TODO @perf: cloning all these Apps isn't great, but since it's just displaying the
|
||||
// help message there are bigger fish to fry
|
||||
let mut sc = self.app.clone();
|
||||
|
||||
for cmd in cmds.iter() {
|
||||
|
|
Loading…
Reference in a new issue