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

Add the timeout flag #131

Merged
merged 1 commit into from
Apr 26, 2021
Merged

Add the timeout flag #131

merged 1 commit into from
Apr 26, 2021

Conversation

sorairolake
Copy link
Contributor

See: #4

Copy link
Owner

@ducaale ducaale left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to implement this 😀. I have one comment regarding the validation

src/main.rs Outdated Show resolved Hide resolved
@sorairolake sorairolake requested a review from ducaale April 23, 2021 05:38
Copy link
Collaborator

@blyxxyz blyxxyz left a comment

Choose a reason for hiding this comment

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

Nice work!

src/main.rs Outdated Show resolved Hide resolved
tests/cli.rs Outdated Show resolved Hide resolved
src/main.rs Outdated
Comment on lines 78 to 87
let timeout = if let Some(timeout) = args.timeout {
let timeout = timeout.as_duration();
if timeout == Duration::default() {
None
} else {
Some(timeout)
}
} else {
None
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this logic could go inside as_duration(), and that could return an Option<Duration> instead?

@sorairolake sorairolake requested a review from blyxxyz April 24, 2021 14:21
Comment on lines +78 to +81
let timeout = args
.timeout
.map(|t| t.as_duration())
.filter(|t| t != &Duration::from_nanos(0));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice improvement!

I still think it would make a bit more sense to have this inside as_duration() but it doesn't really matter.

@sorairolake
Copy link
Contributor Author

Change the newline of README.md and assets/basic/* to LF. Because only these are different from others.

@ducaale
Copy link
Owner

ducaale commented Apr 25, 2021

@sorairolake would you like to implement the optional changes requested by @blyxxyz before we merge this?

Edit: On second thought, I think this could be done outside of this PR

@ducaale ducaale merged commit 2c3e85e into ducaale:develop Apr 26, 2021
@sorairolake sorairolake deleted the feature/timeout branch May 28, 2021 09:25
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.

3 participants