From 2465286dc6859354047dfe0f276576e7dd0956b2 Mon Sep 17 00:00:00 2001 From: Jason Wolkovitz Date: Mon, 1 Jan 2018 21:57:01 -0500 Subject: [PATCH 1/2] fixed simple warnings --- .../Sources/PathIndexable/PathIndexable+Subscripting.swift | 4 ++-- Packages/Polymorphic-1.0.0/Sources/String+Polymorphic.swift | 4 ++-- Sources/Genome/Mapping/Map.swift | 2 +- Sources/GenomeCoreData/CoreData.swift | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Packages/PathIndexable-1.0.0/Sources/PathIndexable/PathIndexable+Subscripting.swift b/Packages/PathIndexable-1.0.0/Sources/PathIndexable/PathIndexable+Subscripting.swift index c5fa9d4..759efe7 100644 --- a/Packages/PathIndexable-1.0.0/Sources/PathIndexable/PathIndexable+Subscripting.swift +++ b/Packages/PathIndexable-1.0.0/Sources/PathIndexable/PathIndexable+Subscripting.swift @@ -68,7 +68,7 @@ extension PathIndexable { extension PathIndexable { public subscript(path path: String) -> Self? { get { - let comps = path.characters.split(separator: ".").map(String.init) + let comps = path.split(separator: ".").map(String.init) return self[comps] } set { @@ -101,7 +101,7 @@ extension PathIndexable { extension String { internal func keyPathComponents() -> [String] { - return characters + return self .split(separator: ".") .map(String.init) } diff --git a/Packages/Polymorphic-1.0.0/Sources/String+Polymorphic.swift b/Packages/Polymorphic-1.0.0/Sources/String+Polymorphic.swift index b442528..4a59259 100644 --- a/Packages/Polymorphic-1.0.0/Sources/String+Polymorphic.swift +++ b/Packages/Polymorphic-1.0.0/Sources/String+Polymorphic.swift @@ -71,7 +71,7 @@ extension String: Polymorphic { multiple entries. */ public var array: [Polymorphic]? { - return characters + return self .split(separator: ",") .map { String($0) } .map { $0.trimmedWhitespace() } @@ -89,7 +89,7 @@ extension String: Polymorphic { extension String { func trimmedWhitespace() -> String { - var characters = self.characters + var characters = self while characters.first?.isWhitespace == true { characters.removeFirst() diff --git a/Sources/Genome/Mapping/Map.swift b/Sources/Genome/Mapping/Map.swift index df9313d..52d1798 100644 --- a/Sources/Genome/Mapping/Map.swift +++ b/Sources/Genome/Mapping/Map.swift @@ -106,7 +106,7 @@ extension Map { } public subscript(path path: String) -> Map { - let components = path.characters + let components = path .split(separator: ".") .map { String($0) } return self[components] diff --git a/Sources/GenomeCoreData/CoreData.swift b/Sources/GenomeCoreData/CoreData.swift index edd8a41..ac9d92c 100644 --- a/Sources/GenomeCoreData/CoreData.swift +++ b/Sources/GenomeCoreData/CoreData.swift @@ -14,7 +14,6 @@ open class ManagedObject: NSManagedObject, Genome.MappableBase { open class var entityName: String { return "\(self)" - .characters .split { $0 == "." } .map(String.init) .last ?? "\(self)" From 538c43ac01f47a0c05305a528c7287e6d47b1693 Mon Sep 17 00:00:00 2001 From: Jason Wolkovitz Date: Wed, 29 Aug 2018 17:32:48 -0400 Subject: [PATCH 2/2] xcode 10 fixes --- .../Genome/Mapping/StandardOperators.swift | 108 ------------------ 1 file changed, 108 deletions(-) diff --git a/Sources/Genome/Mapping/StandardOperators.swift b/Sources/Genome/Mapping/StandardOperators.swift index 8816fab..cf20f6c 100644 --- a/Sources/Genome/Mapping/StandardOperators.swift +++ b/Sources/Genome/Mapping/StandardOperators.swift @@ -67,15 +67,6 @@ public func <~ (reference: inout T, map: Map) throws { } } -public func <~ (reference: inout T!, map: Map) throws { - switch map.type { - case .toNode: - break - case .fromNode: - reference = try map.extract(map.lastPath) - } -} - public func <~ (reference: inout T?, map: Map) throws { switch map.type { case .toNode: @@ -94,15 +85,6 @@ public func <~ (reference: inout [T], map: Map) throws { } } -public func <~ (reference: inout [T]!, map: Map) throws { - switch map.type { - case .toNode: - break - case .fromNode: - reference = try map.extract(map.lastPath) - } -} - public func <~ (reference: inout [T]?, map: Map) throws { switch map.type { case .toNode: @@ -121,15 +103,6 @@ public func <~ (reference: inout [[T]], map: Map) throws { } } -public func <~ (reference: inout [[T]]!, map: Map) throws { - switch map.type { - case .toNode: - break - case .fromNode: - reference = try map.extract(map.lastPath) - } -} - public func <~ (reference: inout [[T]]?, map: Map) throws { switch map.type { case .toNode: @@ -148,15 +121,6 @@ public func <~ (reference: inout [String : T], map: Map) t } } -public func <~ (reference: inout [String : T]!, map: Map) throws { - switch map.type { - case .toNode: - break - case .fromNode: - reference = try map.extract(map.lastPath) - } -} - public func <~ (reference: inout [String : T]?, map: Map) throws { switch map.type { case .toNode: @@ -175,15 +139,6 @@ public func <~ (reference: inout [String : [T]], map: Map) } } -public func <~ (reference: inout [String : [T]]!, map: Map) throws { - switch map.type { - case .toNode: - break - case .fromNode: - reference = try map.extract(map.lastPath) - } -} - public func <~ (reference: inout [String : [T]]?, map: Map) throws { switch map.type { case .toNode: @@ -202,15 +157,6 @@ public func <~ (reference: inout Set, map: Map) throws } } -public func <~ (reference: inout Set!, map: Map) throws { - switch map.type { - case .toNode: - break - case .fromNode: - reference = try map.extract(map.lastPath) - } -} - public func <~ (reference: inout Set?, map: Map) throws { switch map.type { case .toNode: @@ -233,15 +179,6 @@ public func <~> (reference: inout T, map: Map) throws { } } -public func <~> (reference: inout T!, map: Map) throws { - switch map.type { - case .toNode: - try reference ~> map - case .fromNode: - try reference <~ map - } -} - public func <~> (reference: inout T?, map: Map) throws { switch map.type { case .toNode: @@ -260,15 +197,6 @@ public func <~> (reference: inout [T], map: Map) throws { } } -public func <~> (reference: inout [T]!, map: Map) throws { - switch map.type { - case .toNode: - try reference ~> map - case .fromNode: - try reference <~ map - } -} - public func <~> (reference: inout [T]?, map: Map) throws { switch map.type { case .toNode: @@ -287,15 +215,6 @@ public func <~> (reference: inout [[T]], map: Map) throws { } } -public func <~> (reference: inout [[T]]!, map: Map) throws { - switch map.type { - case .toNode: - try reference ~> map - case .fromNode: - try reference <~ map - } -} - public func <~> (reference: inout [[T]]?, map: Map) throws { switch map.type { case .toNode: @@ -314,15 +233,6 @@ public func <~> (reference: inout [String : T], map: Map) th } } -public func <~> (reference: inout [String : T]!, map: Map) throws { - switch map.type { - case .toNode: - try reference ~> map - case .fromNode: - try reference <~ map - } -} - public func <~> (reference: inout [String : T]?, map: Map) throws { switch map.type { case .toNode: @@ -341,15 +251,6 @@ public func <~> (reference: inout [String : [T]], map: Map) } } -public func <~> (reference: inout [String : [T]]!, map: Map) throws { - switch map.type { - case .toNode: - try reference ~> map - case .fromNode: - try reference <~ map - } -} - public func <~> (reference: inout [String : [T]]?, map: Map) throws { switch map.type { case .toNode: @@ -368,15 +269,6 @@ public func <~> (reference: inout Set, map: Map) throws { } } -public func <~> (reference: inout Set!, map: Map) throws { - switch map.type { - case .toNode: - try reference ~> map - case .fromNode: - try reference <~ map - } -} - public func <~> (reference: inout Set?, map: Map) throws { switch map.type { case .toNode: