How to be DRY on ranges and closed ranges?

Yes, it is so inconvenient to use that CloseRange isn’t the special of Range. But according to your case, CountableRange can be used in the condition. And ClosedCountableRange and CountableRange is available to converting. Refer: Ranges in Swift 3 – Ole Begemann