FileSystemType properties can no longer be nil

This commit is contained in:
Timofey Solomko
2017-11-11 11:46:22 +03:00
parent 85c9cdf611
commit 6b8c90f0bd
4 changed files with 6 additions and 11 deletions
+2 -4
View File
@@ -7,7 +7,7 @@ import Foundation
extension FileSystemType {
init?(_ gzipOS: UInt8) {
init(_ gzipOS: UInt8) {
switch gzipOS {
case 0:
self = .fat
@@ -17,10 +17,8 @@ extension FileSystemType {
self = .macintosh
case 11:
self = .ntfs
case 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 255:
self = .other
default:
return nil
self = .other
}
}
+1 -2
View File
@@ -32,9 +32,8 @@ public struct GzipHeader {
*/
public let modificationTime: Date?
// TODO: Explain why can be nil?
/// Type of file system on which archivation took place.
public let osType: FileSystemType?
public let osType: FileSystemType
/// Name of the original file. If archive doesn't contain file's name, then `nil`.
public let fileName: String?
+2 -4
View File
@@ -7,7 +7,7 @@ import Foundation
extension FileSystemType {
init?(_ versionMadeBy: UInt16) {
init(_ versionMadeBy: UInt16) {
switch (versionMadeBy & 0xFF00) >> 8 {
case 0, 14:
self = .fat
@@ -17,10 +17,8 @@ extension FileSystemType {
self = .macintosh
case 10:
self = .ntfs
case 1, 2, 4, 5, 6, 8, 9, 11, 12, 13, 15, 16, 17, 18:
self = .other
default:
return nil
self = .other
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ public struct ZipEntryInfo: ContainerEntryInfo {
/// True, if entry is likely to be text or ASCII file.
public let isTextFile: Bool
public let fileSystemType: FileSystemType?
public let fileSystemType: FileSystemType
public let compressionMethod: CompressionMethod