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

refactor: if let .. else .. to match statement #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kintaro
Copy link

@Kintaro Kintaro commented Dec 12, 2016

This pull request changes the if let {} else {} statements to match, which seems a bit more rustified.
If there is no else branch, if let is a nice shorthand though.

Also, I removed the todo comment is 0 is EOF. If you look at https://doc.rust-lang.org/std/io/trait.Read.html#tymethod.read, that is exactly the case.

This pull request changes the if let {} else {} statements to match, which seems a bit more rustified.
If there is no else branch, if let is a nice shorthand though.
@dpc
Copy link
Owner

dpc commented Dec 12, 2016

So the EOF thing is about ending the Stream (by returning None) on ret == 0 . Plus on Ctrl+D or something like it. Right now it's necessary to kill demo to fnish it.

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.

2 participants