async-readline icon indicating copy to clipboard operation
async-readline copied to clipboard

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

Open Kintaro opened this issue 9 years ago • 1 comments

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.

Kintaro avatar Dec 12 '16 10:12 Kintaro

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.

dpc avatar Dec 12 '16 18:12 dpc