[T]
has the method contains
, Vec
derefs to [T]
and thus has it, too. VecDeque
, using two slices internally, does not have a comparable method. I think that such a method should be added. Sure, there are other possibilities to check if a VecDeque
contains a specific element (e.g. deq.iter().any(|e| e == item)
). But contains
expresses the intent in the method name, is shorter and (I would argue) more idiomatic.
Also see: http://stackoverflow.com/questions/35583148/check-if-vecdeque-contains-an-element
What do you think? Should I craft an RFC for this?