Manishearth / elsa

Append-only collections for Rust where borrows to entries can outlive insertions
Apache License 2.0
228 stars 33 forks source link

Question: Why cannot insert `usize` to FrozenIndexMap? #73

Closed namse closed 8 months ago

namse commented 8 months ago

I guess FrozenIndexMap's value type needs to be StableDeref, Is not stable to deref for usize?

Manishearth commented 8 months ago

No, it must be allocated. This is what gives the map the frozen property.

A thing we could potentially do is also support FrozenIndexMap for Copy types where it doesn't return references.