session-ios/SessionUtilitiesKit/General/Array+Utilities.swift

14 lines
309 B
Swift
Raw Permalink Normal View History

2020-11-05 02:07:21 +01:00
2020-11-05 02:15:57 +01:00
public extension Array where Element : CustomStringConvertible {
2020-11-05 02:07:21 +01:00
2020-11-05 09:23:05 +01:00
var prettifiedDescription: String {
2020-11-05 02:07:21 +01:00
return "[ " + map { $0.description }.joined(separator: ", ") + " ]"
}
}
public extension Array where Element: Hashable {
func asSet() -> Set<Element> {
return Set(self)
}
}