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
I find it surprising that things like impl<A> Debug for Vector<A> require A: Clone. I have looked at the implementation and I'm pretty sure it should be possible to loosen Clone trait bounds in many places. Would PRs for that be welcome?
The text was updated successfully, but these errors were encountered:
just read the doc https://docs.rs/im/latest/im/#when-does-cloning-happen . TLDR Clone of small-ish values is faster than alternatives and if you have big values just use Rc<...> or Arc<...> where it clones just the pointer
It cannot be changed without complete redesign. It has optimized like this for a reason that there are small opportunistic arrays that get cloned when needed
It can be changed. imbl, which is a maintained fork of im, implements some of the required changes (I recently contributed some myself). Note that I am not asking to make Vector<T> a properly usable type that values can be pushed to / that can be cloned or whatever. I just want to be able to drive Debug for a generic type that holds Vector<T> (which I have done successfully, since switching to imbl).
I find it surprising that things like
impl<A> Debug for Vector<A>
requireA: Clone
. I have looked at the implementation and I'm pretty sure it should be possible to loosenClone
trait bounds in many places. Would PRs for that be welcome?The text was updated successfully, but these errors were encountered: