fn check_for_duplicates<'t, T>(
items: impl IntoIterator<Item = Cow<'t, T>>,
error_wrapper: impl FnOnce(T) -> TransactionError,
) -> Result<(), TransactionError>
Expand description
Check for duplicate items in a collection.
Each item should be wrapped by a Cow
instance so that this helper function can properly
handle borrowed items and owned items.
If a duplicate is found, an error created by the error_wrapper
is returned.