-
Notifications
You must be signed in to change notification settings - Fork 65
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
use the new std::io::{Error, Result} #14
Conversation
Returning an empty slice is not ideal as we probably want to communicate that there's been some kind of error. Looking through the docs,
Especially given this passage in the description of
(bold mine, emphasis theirs) |
Sure, that was my point, that you guys would probably know best how to handle it. Do whatever you think is best. |
Actually I don't think
In any case, if The emphasized text in the docs for I'm changing the code to instead return an |
Thanks for the contribution! This looks good, I'm going to merge. Regarding
I'm not too sure about that detail. If it can never happen (except due to a bug in inotify-rs, which the user has no control over), then I think a I'm going to open an issue about that for now. I'm going to look into it when I have a bit more time. Or, if you're confident that the behaviour is indeed as you described, feel free to open a new pull request for that, if you want. |
use the new std::io::{Error, Result}
So on line 123, there's no longer an
EndOfFile
variant ofErrorKind
. The calls toread
now return a0
in the case of EOF (see docs). I wasn't sure what to do in the event of0
in this case. I checked the man page and it said:I'm not sure what an 'end of file' in the context of inotify is. Maybe we'll have to create our own enum variant to represent this. I return an empty slice for now.