pub fn slice_idx<T: PartialEq>(arr: &[T], elem: &T) -> i32
Find the index of an element in a slice. Returns -1 if not found.