-
Notifications
You must be signed in to change notification settings - Fork 247
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
API error #721
Comments
Hi, and thanks for the report. Indeed, the entire chain of methods around I felt like the extra code duplication was not quite justified given that users very often have mutable access to the views, but there may be exceptions of course. |
Hi, |
It could, but as I said it would require a non-mutable version of the current As I mentioned, it's possible to have such non-mutable duplicates of the various functions, it's just rarely required. |
If the find method didn't require &mut you wouldn't have to have code dups. All that would happen: the find method would have better API. |
Note that And you'd probably still want a If this use-case pattern is very common, then the code duplication could be justified, absolutely. I'd also welcome any PR to help improve the API! |
Thank you for the reply. If I find a free time I'll try to look at your code and see if it can be refactored/structured in better way. |
API design is incorrect. In order to find something I shouldn't require to have mutable access to neither the container that holds it nor the thing itself. Unfortunately at this moment I need mut access to perform find.
The text was updated successfully, but these errors were encountered: