clean up various xcode warnings

This commit is contained in:
Jake Van Alstyne 🎩 2017-11-17 16:49:16 -07:00
parent a9f79a3b80
commit db0a955e03
4 changed files with 141 additions and 141 deletions

View File

@ -10,11 +10,11 @@ public class CommitIterator: IteratorProtocol, Sequence {
public typealias Iterator = CommitIterator public typealias Iterator = CommitIterator
public typealias Element = Result<Commit, NSError> public typealias Element = Result<Commit, NSError>
let repo: Repository let repo: Repository
private var revisionWalker: OpaquePointer? = nil private var revisionWalker: OpaquePointer?
private enum Next { private enum Next {
case over case over
case ok case okay
case error(NSError) case error(NSError)
init(_ result: Int32, name: String) { init(_ result: Int32, name: String) {
@ -22,7 +22,7 @@ public class CommitIterator: IteratorProtocol, Sequence {
case GIT_ITEROVER.rawValue: case GIT_ITEROVER.rawValue:
self = .over self = .over
case GIT_OK.rawValue: case GIT_OK.rawValue:
self = .ok self = .okay
default: default:
self = .error(NSError(gitError: result, pointOfFailure: name)) self = .error(NSError(gitError: result, pointOfFailure: name))
} }
@ -55,7 +55,7 @@ public class CommitIterator: IteratorProtocol, Sequence {
return Result.failure(error) return Result.failure(error)
case .over: case .over:
return nil return nil
case .ok: case .okay:
var unsafeCommit: OpaquePointer? = nil var unsafeCommit: OpaquePointer? = nil
let lookupGitResult = git_commit_lookup(&unsafeCommit, repo.pointer, &oid) let lookupGitResult = git_commit_lookup(&unsafeCommit, repo.pointer, &oid)
guard lookupGitResult == GIT_OK.rawValue, guard lookupGitResult == GIT_OK.rawValue,
@ -76,7 +76,7 @@ public class CommitIterator: IteratorProtocol, Sequence {
public func map<T>(_ transform: (Result<Commit, NSError>) throws -> T) rethrows -> [T] { public func map<T>(_ transform: (Result<Commit, NSError>) throws -> T) rethrows -> [T] {
var new: [T] = [] var new: [T] = []
for item in self { for item in self {
new = new + [try transform(item)] new += [try transform(item)]
} }
return new return new
} }
@ -85,7 +85,7 @@ public class CommitIterator: IteratorProtocol, Sequence {
var new: [Result<Commit, NSError>] = [] var new: [Result<Commit, NSError>] = []
for item in self { for item in self {
if try isIncluded(item) { if try isIncluded(item) {
new = new + [item] new += [item]
} }
} }
return new return new
@ -104,12 +104,12 @@ public class CommitIterator: IteratorProtocol, Sequence {
self.repo = repo self.repo = repo
} }
public func dropFirst(_ n: Int) -> AnySequence<Iterator.Element> { public func dropFirst(_ num: Int) -> AnySequence<Iterator.Element> {
notImplemented(functionName: self.dropFirst) notImplemented(functionName: self.dropFirst)
return AnySequence<Iterator.Element> { return CommitIterator(repo: self.repo) } return AnySequence<Iterator.Element> { return CommitIterator(repo: self.repo) }
} }
public func dropLast(_ n: Int) -> AnySequence<Iterator.Element> { public func dropLast(_ num: Int) -> AnySequence<Iterator.Element> {
notImplemented(functionName: self.dropLast) notImplemented(functionName: self.dropLast)
return AnySequence<Iterator.Element> { return CommitIterator(repo: self.repo) } return AnySequence<Iterator.Element> { return CommitIterator(repo: self.repo) }
} }

View File

@ -49,20 +49,20 @@ public struct Diff {
} }
public let rawValue: UInt32 public let rawValue: UInt32
public static let current = Status(rawValue: 0) public static let current = Status(rawValue: 0)
public static let indexNew = Status(rawValue: 1 << 0) public static let indexNew = Status(rawValue: 1 << 0)
public static let indexModified = Status(rawValue: 1 << 1) public static let indexModified = Status(rawValue: 1 << 1)
public static let indexDeleted = Status(rawValue: 1 << 2) public static let indexDeleted = Status(rawValue: 1 << 2)
public static let indexRenamed = Status(rawValue: 1 << 3) public static let indexRenamed = Status(rawValue: 1 << 3)
public static let indexTypeChange = Status(rawValue: 1 << 4) public static let indexTypeChange = Status(rawValue: 1 << 4)
public static let workTreeNew = Status(rawValue: 1 << 5) public static let workTreeNew = Status(rawValue: 1 << 5)
public static let workTreeModified = Status(rawValue: 1 << 6) public static let workTreeModified = Status(rawValue: 1 << 6)
public static let workTreeDeleted = Status(rawValue: 1 << 7) public static let workTreeDeleted = Status(rawValue: 1 << 7)
public static let workTreeTypeChange = Status(rawValue: 1 << 8) public static let workTreeTypeChange = Status(rawValue: 1 << 8)
public static let workTreeRenamed = Status(rawValue: 1 << 9) public static let workTreeRenamed = Status(rawValue: 1 << 9)
public static let workTreeUnreadable = Status(rawValue: 1 << 10) public static let workTreeUnreadable = Status(rawValue: 1 << 10)
public static let ignored = Status(rawValue: 1 << 11) public static let ignored = Status(rawValue: 1 << 11)
public static let conflicted = Status(rawValue: 1 << 12) public static let conflicted = Status(rawValue: 1 << 12)
} }
public struct Flags: OptionSet { public struct Flags: OptionSet {

View File

@ -629,7 +629,7 @@ class RepositorySpec: QuickSpec {
"List branches in README\n", "List branches in README\n",
"Create a README\n", "Create a README\n",
"List branches in README\n", "List branches in README\n",
"Create a README\n" "Create a README\n",
] ]
var commitMessages: [String] = [] var commitMessages: [String] = []
for branch in branches { for branch in branches {