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 {
20
20
21
21
/// Errors specific to the implementation of ``UniversalArchiver``.
22
22
enum Error : Swift . Error {
23
- case unknownFormat( [ Substring ] , AbsolutePath )
23
+ case unknownFormat( [ String ] , AbsolutePath )
24
24
case noFileNameExtension( AbsolutePath )
25
25
26
26
var description : String {
@@ -66,7 +66,7 @@ public struct UniversalArchiver: Archiver {
66
66
67
67
if let archiver = self . formatMapping [ extensions. joined ( separator: " . " ) ] {
68
68
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] {
70
70
return archiver
71
71
} else {
72
72
throw Error . unknownFormat ( extensions, archivePath)
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ extension AbsolutePath {
41
41
42
42
/// Unlike ``AbsolutePath//extension``, this property returns all characters after the first `.` character in a
43
43
/// `````. 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 ] ? {
45
45
guard let firstDot = basename. firstIndex ( of: " . " ) else {
46
46
return nil
47
47
}
@@ -54,6 +54,6 @@ extension AbsolutePath {
54
54
55
55
extensions. removeFirst ( )
56
56
57
- return extensions. split ( separator: " . " )
57
+ return extensions. split ( separator: " . " ) . map ( String . init )
58
58
}
59
59
}
You can’t perform that action at this time.
0 commit comments