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
EndOfFilevariant ofErrorKind. The calls toreadnow return a0in the case of EOF (see docs). I wasn't sure what to do in the event of0in 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.