Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow replacing input on the fly #1697

Merged
merged 1 commit into from
Feb 21, 2020
Merged

Allow replacing input on the fly #1697

merged 1 commit into from
Feb 21, 2020

Conversation

pksunkara
Copy link
Member

@pksunkara pksunkara commented Feb 17, 2020

Closes #1603

I tried several different ways of implementing the above requested feature but failed because they always ended up trying to manipulate the input which is a no-go because it was a plain Iterator. And then the #1693 was filed, and reading it made me think that maybe we should allow input to be changed. So, I extracted it out and made it do the replacing.

@CreepySkeleton
Copy link
Contributor

I'll give it a deep review in two-three days. I'm overwhelmed by other problems right now, sorry.

Upon a shallow look, I'm somewhat concerned about performance since now we always clone the input. I don't know what the impact will be and I'm trying to benchmark it now. I know, CLI parsing is rarely a big concern, if at all, but clap has always been outstanding regarding to runtime speed, and some users have been choosing it exactly because of it.

By the way, our current benches seem to be useless.

@pksunkara
Copy link
Member Author

I'm somewhat concerned about performance since now we always clone the input. I don't know what the impact will be and I'm trying to benchmark it now

Yup, I was thinking the same.

Copy link
Contributor

@CreepySkeleton CreepySkeleton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty good implementation. While I don't think we should always clone the input, we can rework it later.

Some minor improvements and questions only:

src/build/app/mod.rs Outdated Show resolved Hide resolved
src/parse/parser.rs Show resolved Hide resolved
src/parse/parser.rs Outdated Show resolved Hide resolved
src/build/app/mod.rs Show resolved Hide resolved
@pksunkara pksunkara force-pushed the replace branch 2 times, most recently from 293a370 to 1f48d76 Compare February 21, 2020 16:49
@CreepySkeleton
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 21, 2020

Build succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alias into subcomand
2 participants