-
Notifications
You must be signed in to change notification settings - Fork 64
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
Remove example that works around issue #120 #125
Comments
@hannobraun I would like to take this up. I have opened up a PR for this - #130 |
It seems like (unless I'm completely misunderstanding) the workaround demonstrated in this example only really works if: For instance, this dummy program:
Gets
When a file name is too long. Seems like a limitation on arrays (check https://doc.rust-lang.org/std/primitive.array.html notes on array sizes as they related to AsMut/AsRef). The best work around I've found for this is to include the bytes module as suggested in the original pull request. This seems to work so far:
I guess all of this is to say, it might still be worth having a pretty decent example floating around to show how this works with larger file names/tokio integration/etc. It might be nice to figure out how to provide the max size of the inotify event in order to build reasonably sized buffers. Of course, I have no idea how to do that yet :) |
Thanks for your comment, @emarcotte! I agree with everything you said.
Yes, that is to be expected. I'm hoping that will care of itself soon-ish, once support for const generics lands in the compiler, and is then used to implement those traits for any array size.
Thanks for the example. Really neat! A
Totally agree, but I think the best place for such an examples (or better, multiple such examples) is in the API documentation of the
Yes, it would be great if someone figured out what a reasonable buffer size is, and added that information to the API documentation. |
It's no longer as useful, as #120 is fixed now. It should be removed, and the technique it shows should be integrated into the API documentation.
The text was updated successfully, but these errors were encountered: