mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Hello, mpv! 🎉
This commit is contained in:
7
Extensions/Comparable+Clamped.swift
Normal file
7
Extensions/Comparable+Clamped.swift
Normal file
@@ -0,0 +1,7 @@
|
||||
import Foundation
|
||||
|
||||
extension Comparable {
|
||||
func clamped(to limits: ClosedRange<Self>) -> Self {
|
||||
min(max(self, limits.lowerBound), limits.upperBound)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user