There's no built-in is_unique function. Counting and comparing to one, as you did, is probably the best approach to achieve this functionality.