pub fn same_or_none<T: PartialEq + Clone>(data: &[&T]) -> Option<T>
Utility fn that, given a list of references, returns Some(T) if they are the same, otherwise None