This moves all the implementations of vec_tuple_2_to_hash_map into calling the actual function, now iter_ to allow for these generics. This then adds an early return for the iterator having no items, which gets rid of the somewhat silly vec![].into_iter().collect() and HashMap::from_iter([]) code.
This also does the same for wrap_option, removing the None.map(Duration::from_secs) that was in CooldownConfig.
This moves all the implementations of
vec_tuple_2_to_hash_map
into calling the actual function, nowiter_
to allow for these generics. This then adds an early return for the iterator having no items, which gets rid of the somewhat sillyvec![].into_iter().collect()
andHashMap::from_iter([])
code.This also does the same for
wrap_option
, removing theNone.map(Duration::from_secs)
that was in CooldownConfig.