IME // Allow throwing Strings as Errors.

This commit is contained in:
ShikiSuen 2022-04-11 09:50:09 +08:00
parent 1a74d9de14
commit ea0a6ea3f4
1 changed files with 6 additions and 0 deletions

View File

@ -327,3 +327,9 @@ extension RangeReplaceableCollection where Element: Hashable {
return filter { set.insert($0).inserted }
}
}
// MARK: - Error Extension
extension String: Error {}
extension String: LocalizedError {
public var errorDescription: String? { return self }
}