[xcodegen] Clean up file extension handling

Factor out `FileExtension.matches` and add some tests.
This commit is contained in:
Hamish Knight
2025-05-06 10:18:17 +01:00
parent 3022270150
commit 555bc1b54f
3 changed files with 39 additions and 13 deletions

View File

@@ -74,9 +74,3 @@ extension AnyPath: ExpressibleByArgument {
self.init(rawPath)
}
}
extension StringProtocol {
func hasExtension(_ ext: FileExtension) -> Bool {
FilePath(String(self)).extension == ext.rawValue
}
}