File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments