From b6a6f77d4e93c339c4861c29ea3c3f3d1522c275 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Tue, 8 Mar 2022 10:45:58 +1100 Subject: [PATCH] Adding back code removed due to merge conflict --- .../General/Array+Utilities.swift | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/SessionUtilitiesKit/General/Array+Utilities.swift b/SessionUtilitiesKit/General/Array+Utilities.swift index 0b4d8b7fd..fc5bfbc6f 100644 --- a/SessionUtilitiesKit/General/Array+Utilities.swift +++ b/SessionUtilitiesKit/General/Array+Utilities.swift @@ -1,11 +1,27 @@ +import Foundation -public extension Array where Element : CustomStringConvertible { - +public extension Array where Element: CustomStringConvertible { var prettifiedDescription: String { return "[ " + map { $0.description }.joined(separator: ", ") + " ]" } } +public extension Array { + func appending(_ other: Element) -> [Element] { + var updatedArray: [Element] = self + updatedArray.append(other) + + return updatedArray + } + + func appending(_ other: [Element]) -> [Element] { + var updatedArray: [Element] = self + updatedArray.append(contentsOf: other) + + return updatedArray + } +} + public extension Array where Element: Hashable { func asSet() -> Set { return Set(self)