You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's true that it is much more common to return a borrowed value for data structures like HashMap, Vec, etc. They do it to avoid the clone because of performance reasons. But it also makes it slightly more inconvenient to use.
In this case, I value the ease of use higher, especially since we don't have an actual performance problem with this right now. I'm totally open to change the implementation to a reference, but I don't see the need to put the work in right now.
I've split this review comment out of #30 so it doesn't get lost, since the PR has already been merged.
Originally posted by @hone in https://github.com/Malax/libcnb.rs/pull/30#discussion_r699634420
@Malax Isn't it usually common here to return a borrowed and not cloned from an object?
https://github.com/Malax/libcnb.rs/blob/ac8f17f957d410678b31d268548e40c483eb2ffb/libcnb/src/env.rs#L59-L62
The text was updated successfully, but these errors were encountered: