Closed Eh2406 closed 5 months ago
I rebased which required some intervention due to #183. So while I was looking at it I noticed that we had not made the symmetric change for simplify. So I added that as well. I will give some time for re-review due to the substantive changes.
contains
takes a&V
, because if you haven't ownedV
(even behind the smart pointerBox
/Arc
/Cow
) it is easy to add a&
. Socontains_many
copied that interface and takes an iterator ofItem = &V
. Unfortunately, if you have an iterator ofItem = V
(orItem =
Box
/Arc
/Cow
ofV
) it is not straightforward to get a reference.This came up in the context of semver-pubgrub, whose implementation of contains needs to ignore the
BuildMetadata
part of the semver version. I will be investigating if there are ways to work around this by expressing=x.y.z.pre
as>=x.y.z.pre, <x.y.z.pre.0
. But even ifsemver-pubgrub
does not need this functionality it doesn't hurt to makecontains_many
more flexible.