diff --git a/Package.resolved b/Package.resolved index bfc40a4..e2a148f 100644 --- a/Package.resolved +++ b/Package.resolved @@ -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", diff --git a/Package.swift b/Package.swift index 267ae17..03d4738 100644 --- a/Package.swift +++ b/Package.swift @@ -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"] diff --git a/Sources/IgnorioKit/ContentValidations/UnknownTypesValidator.swift b/Sources/IgnorioKit/ContentValidations/UnknownTypesValidator.swift index c454d9f..4d1588d 100644 --- a/Sources/IgnorioKit/ContentValidations/UnknownTypesValidator.swift +++ b/Sources/IgnorioKit/ContentValidations/UnknownTypesValidator.swift @@ -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]) diff --git a/Sources/IgnorioKit/GitignoreioProvider.swift b/Sources/IgnorioKit/GitignoreioProvider.swift index 673f2a4..407dc88 100644 --- a/Sources/IgnorioKit/GitignoreioProvider.swift +++ b/Sources/IgnorioKit/GitignoreioProvider.swift @@ -7,7 +7,6 @@ // import Foundation -import Result /// Main logic for files retrieving struct GitignoreioProvider { diff --git a/Sources/ignorio/Commands/CreateCommand.swift b/Sources/ignorio/Commands/CreateCommand.swift index fb0cb01..1693502 100644 --- a/Sources/ignorio/Commands/CreateCommand.swift +++ b/Sources/ignorio/Commands/CreateCommand.swift @@ -8,7 +8,6 @@ import Foundation import Commander -import Result import IgnorioKit /// Command for .gitignore file fetch diff --git a/Sources/ignorio/Commands/ListCommand.swift b/Sources/ignorio/Commands/ListCommand.swift index fb2f69d..eef9539 100644 --- a/Sources/ignorio/Commands/ListCommand.swift +++ b/Sources/ignorio/Commands/ListCommand.swift @@ -7,7 +7,6 @@ // import Commander -import Result import IgnorioKit /// Commands which lists supported types for fetch command diff --git a/Sources/ignorio/Validators/TypesValidator.swift b/Sources/ignorio/Validators/TypesValidator.swift index 0c44790..fcc703e 100644 --- a/Sources/ignorio/Validators/TypesValidator.swift +++ b/Sources/ignorio/Validators/TypesValidator.swift @@ -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) } }