-
Notifications
You must be signed in to change notification settings - Fork 220
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
ListIterator
panics while iterating over an improper list
#338
Comments
This isn't really a bug, this is intended behavior. We could add another iterator type which returns an enum for either an element or an improper tail. |
Also, the direct functions are internal only, but This is documented: https://docs.rs/rustler/0.22.0-rc.0/rustler/struct.Term.html#method.list_get_cell Last edit: We could probably add a line to the docs of |
Uh, I overlooked that. Thank you for pointing this out.
It would be great if we had these explanations in the doc. |
If
ListIterator
tries to iterate over an improper list, it panics while retrieving its elements.Is it possible for
ListIterator
to fail in a modest way like throwing errors, rather thanpanic!
-ing?Besides, because the functions in
rustler::types::list
are hidden, there are no documented ways to decouple improper lists (e.g.rustler::types::lists::list_get_cell
). It would be very helpful if they were documented.Here is the output:
(Code used to reproduce this
panic!
-ing: https://github.com/koba-e964/phx_rust_21/compare/bug/improper-lists)The text was updated successfully, but these errors were encountered: