Skip to content

Commit

Permalink
Update for swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
josefdolezal committed Apr 8, 2019
1 parent 4e5f531 commit 255266a
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 18 deletions.
9 changes: 0 additions & 9 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
"version": "0.8.0"
}
},
{
"package": "Result",
"repositoryURL": "https://github.com/antitypical/Result.git",
"state": {
"branch": null,
"revision": "7477584259bfce2560a19e06ad9f71db441fff11",
"version": "3.2.4"
}
},
{
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
Expand Down
6 changes: 2 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/kylef/Commander.git", .upToNextMinor(from: "0.8.0")),
.package(url: "https://github.com/antitypical/Result.git", .upToNextMinor(from: "3.2.4"))
],
targets: [
.target(
name: "ignorio",
dependencies: ["IgnorioKit", "Result", "Commander"]),
dependencies: ["IgnorioKit", "Commander"]),
.target(
name: "IgnorioKit",
dependencies: ["Result"]),
name: "IgnorioKit"),
.testTarget(
name: "IgnorioKitTests",
dependencies: ["IgnorioKit"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public func unknownTypesValidator(content: String) throws {
.filter { $0.numberOfRanges > 1 }

// Check the content for matches
let typeErrors = matches.flatMap { match in
let typeErrors = matches.compactMap { match -> String? in
guard let range = Range(match.range(at: 1), in: content) else { return nil }

return String(content[range])
Expand Down
1 change: 0 additions & 1 deletion Sources/IgnorioKit/GitignoreioProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import Foundation
import Result

/// Main logic for files retrieving
struct GitignoreioProvider {
Expand Down
1 change: 0 additions & 1 deletion Sources/ignorio/Commands/CreateCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import Foundation
import Commander
import Result
import IgnorioKit

/// Command for .gitignore file fetch
Expand Down
1 change: 0 additions & 1 deletion Sources/ignorio/Commands/ListCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import Commander
import Result
import IgnorioKit

/// Commands which lists supported types for fetch command
Expand Down
2 changes: 1 addition & 1 deletion Sources/ignorio/Validators/TypesValidator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ func typesValidator(_ types: [String]) throws -> [String] {
throw IgnorioError.zeroTypesCount
}

return types.flatMap({ $0.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) })
return types.compactMap { $0.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) }
}

0 comments on commit 255266a

Please sign in to comment.