Why doesn't fn() coerce to fn() capturing
This works thanks to the signatures being different:
However it's still annoying to duplicate every function twice.
However it's still annoying to duplicate every function twice.
fn first(self, where: fn(T) -> Bool) -> Optional[T]:
for item in self:
if where(item): return item
return Optional[T]()
fn first(self, where: fn(T) capturing -> Bool) -> Optional[T]:
for item in self:
if where(item): return item
return Optional[T]()