-
Notifications
You must be signed in to change notification settings - Fork 239
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
Inconsistency between documentation and code implementation #772
Comments
Thanks for the report! For
For
Insertion at the end of the list is actually possible - it's effectively appending the entry to the list. This is why |
Hi, Many thanks for your help. I understand your point, but I do not think“out-of-bound” crash is the behavior we expect. The ideal situation is to inform the "user" what should happen if it is out-of-bound. Thus, I think we may use the get and get_mut to check whether the index is in the Vec. Thanks! |
In each of these cases, users could check first if We could add variants that return |
I noticed a possible panic due to inconsistency between documentation and code implementation in cursive-main/cursive-core/src/views/linear_layout.rs. The details can be found in the following code. The code does not check whether i is out of bounds before use it directly.
The similar situation can be found in cursive-main/cursive-core/src/views/list_view.rs
Besides I think this documentation in cursive-main/cursive-core/src/views/linear_layout.rs is not complete, which should be "Panics if
i >= self.len()
" instead of "Panics ifi > self.len()
"The text was updated successfully, but these errors were encountered: