Closed hengfeiyang closed 6 months ago
Now the contains_key define like this
contains_key
pub fn contains_key<Q>(&mut self, key: &Q) -> bool
But this function don't need update the order of element right, it only check the element is exist or not. Can we change it like this:
pub fn contains_key<Q>(&self, key: &Q) -> bool
Or add a new function like this:
pub fn contains_key_mut<Q>(&mut self, key: &Q) -> bool pub fn contains_key<Q>(&self, key: &Q) -> bool
Like standard HashMap: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.contains_key
I have no earthly idea why that method takes &mut self, fixing it.
&mut self
Can you publish a new release? i want to use this feature. thank you.
I'll make a release soon and leave this issue open until I do
Now the
contains_key
define like thisBut this function don't need update the order of element right, it only check the element is exist or not. Can we change it like this:
Or add a new function like this:
Like standard HashMap: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.contains_key