Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed warnings on deprecated characters property of String #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -101,7 +101,7 @@ extension PathIndexable {

extension String {
internal func keyPathComponents() -> [String] {
return characters
return self
.split(separator: ".")
.map(String.init)
}
Expand Down
4 changes: 2 additions & 2 deletions Packages/Polymorphic-1.0.0/Sources/String+Polymorphic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Sources/Genome/Mapping/Map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
108 changes: 0 additions & 108 deletions Sources/Genome/Mapping/StandardOperators.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ public func <~ <T: NodeInitializable>(reference: inout T, map: Map) throws {
}
}

public func <~ <T: NodeInitializable>(reference: inout T!, map: Map) throws {
switch map.type {
case .toNode:
break
case .fromNode:
reference = try map.extract(map.lastPath)
}
}

public func <~ <T: NodeInitializable>(reference: inout T?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -94,15 +85,6 @@ public func <~ <T: NodeInitializable>(reference: inout [T], map: Map) throws {
}
}

public func <~ <T: NodeInitializable>(reference: inout [T]!, map: Map) throws {
switch map.type {
case .toNode:
break
case .fromNode:
reference = try map.extract(map.lastPath)
}
}

public func <~ <T: NodeInitializable>(reference: inout [T]?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -121,15 +103,6 @@ public func <~ <T: NodeInitializable>(reference: inout [[T]], map: Map) throws {
}
}

public func <~ <T: NodeInitializable>(reference: inout [[T]]!, map: Map) throws {
switch map.type {
case .toNode:
break
case .fromNode:
reference = try map.extract(map.lastPath)
}
}

public func <~ <T: NodeInitializable>(reference: inout [[T]]?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -148,15 +121,6 @@ public func <~ <T: NodeInitializable>(reference: inout [String : T], map: Map) t
}
}

public func <~ <T: NodeInitializable>(reference: inout [String : T]!, map: Map) throws {
switch map.type {
case .toNode:
break
case .fromNode:
reference = try map.extract(map.lastPath)
}
}

public func <~ <T: NodeInitializable>(reference: inout [String : T]?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -175,15 +139,6 @@ public func <~ <T: NodeInitializable>(reference: inout [String : [T]], map: Map)
}
}

public func <~ <T: NodeInitializable>(reference: inout [String : [T]]!, map: Map) throws {
switch map.type {
case .toNode:
break
case .fromNode:
reference = try map.extract(map.lastPath)
}
}

public func <~ <T: NodeInitializable>(reference: inout [String : [T]]?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -202,15 +157,6 @@ public func <~ <T: NodeInitializable>(reference: inout Set<T>, map: Map) throws
}
}

public func <~ <T: NodeInitializable>(reference: inout Set<T>!, map: Map) throws {
switch map.type {
case .toNode:
break
case .fromNode:
reference = try map.extract(map.lastPath)
}
}

public func <~ <T: NodeInitializable>(reference: inout Set<T>?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -233,15 +179,6 @@ public func <~> <T: NodeConvertible>(reference: inout T, map: Map) throws {
}
}

public func <~> <T: NodeConvertible>(reference: inout T!, map: Map) throws {
switch map.type {
case .toNode:
try reference ~> map
case .fromNode:
try reference <~ map
}
}

public func <~> <T: NodeConvertible>(reference: inout T?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -260,15 +197,6 @@ public func <~> <T: NodeConvertible>(reference: inout [T], map: Map) throws {
}
}

public func <~> <T: NodeConvertible>(reference: inout [T]!, map: Map) throws {
switch map.type {
case .toNode:
try reference ~> map
case .fromNode:
try reference <~ map
}
}

public func <~> <T: NodeConvertible>(reference: inout [T]?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -287,15 +215,6 @@ public func <~> <T: NodeConvertible>(reference: inout [[T]], map: Map) throws {
}
}

public func <~> <T: NodeConvertible>(reference: inout [[T]]!, map: Map) throws {
switch map.type {
case .toNode:
try reference ~> map
case .fromNode:
try reference <~ map
}
}

public func <~> <T: NodeConvertible>(reference: inout [[T]]?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -314,15 +233,6 @@ public func <~> <T: NodeConvertible>(reference: inout [String : T], map: Map) th
}
}

public func <~> <T: NodeConvertible>(reference: inout [String : T]!, map: Map) throws {
switch map.type {
case .toNode:
try reference ~> map
case .fromNode:
try reference <~ map
}
}

public func <~> <T: NodeConvertible>(reference: inout [String : T]?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -341,15 +251,6 @@ public func <~> <T: NodeConvertible>(reference: inout [String : [T]], map: Map)
}
}

public func <~> <T: NodeConvertible>(reference: inout [String : [T]]!, map: Map) throws {
switch map.type {
case .toNode:
try reference ~> map
case .fromNode:
try reference <~ map
}
}

public func <~> <T: NodeConvertible>(reference: inout [String : [T]]?, map: Map) throws {
switch map.type {
case .toNode:
Expand All @@ -368,15 +269,6 @@ public func <~> <T: NodeConvertible>(reference: inout Set<T>, map: Map) throws {
}
}

public func <~> <T: NodeConvertible>(reference: inout Set<T>!, map: Map) throws {
switch map.type {
case .toNode:
try reference ~> map
case .fromNode:
try reference <~ map
}
}

public func <~> <T: NodeConvertible>(reference: inout Set<T>?, map: Map) throws {
switch map.type {
case .toNode:
Expand Down
1 change: 0 additions & 1 deletion Sources/GenomeCoreData/CoreData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down