Skip to content

Commit 1ae861c

Browse files
committed
Address PR feedback
1 parent 0a644e9 commit 1ae861c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/Basics/Archiver/UniversalArchiver.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public struct UniversalArchiver: Archiver {
2020

2121
/// Errors specific to the implementation of ``UniversalArchiver``.
2222
enum Error: Swift.Error {
23-
case unknownFormat([Substring], AbsolutePath)
23+
case unknownFormat([String], AbsolutePath)
2424
case noFileNameExtension(AbsolutePath)
2525

2626
var description: String {
@@ -66,7 +66,7 @@ public struct UniversalArchiver: Archiver {
6666

6767
if let archiver = self.formatMapping[extensions.joined(separator: ".")] {
6868
return archiver
69-
} else if let lastExtension = extensions.last, let archiver = self.formatMapping[String(lastExtension)] {
69+
} else if let lastExtension = extensions.last, let archiver = self.formatMapping[lastExtension] {
7070
return archiver
7171
} else {
7272
throw Error.unknownFormat(extensions, archivePath)

Sources/Basics/FileSystem/Path+Extensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ extension AbsolutePath {
4141

4242
/// Unlike ``AbsolutePath//extension``, this property returns all characters after the first `.` character in a
4343
/// `````. If no dot character is present in the filename or first dot is the last character, `nil` is returned.
44-
var allExtensions: [Substring]? {
44+
var allExtensions: [String]? {
4545
guard let firstDot = basename.firstIndex(of: ".") else {
4646
return nil
4747
}
@@ -54,6 +54,6 @@ extension AbsolutePath {
5454

5555
extensions.removeFirst()
5656

57-
return extensions.split(separator: ".")
57+
return extensions.split(separator: ".").map(String.init)
5858
}
5959
}

0 commit comments

Comments
 (0)