From b9f325f91b44fa732ef8c7d4426732d86fcc2139 Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Wed, 7 Feb 2018 23:59:42 +0300 Subject: [PATCH] Small text/comments-related changes --- .gitignore | 4 ++-- Sources/Common/Container/ContainerEntryType.swift | 1 + .../ContainerEntryInfo+CustomStringConvertible.swift | 3 +-- .../GzipHeader+CustomStringConvertible.swift | 10 ++++++---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 23120e2b..d27d5587 100644 --- a/.gitignore +++ b/.gitignore @@ -64,10 +64,10 @@ fastlane/Preview.html fastlane/screenshots fastlane/test_output -# Ignore symbolic link to swcomp executable built by SPM. +# Ignore symbolic link to swcomp executable built by SPM /swcomp -# Ignore Package.resolved, because there is no dependencies by default for this package. +# Ignore Package.resolved, because we don't want to fix dependencies' versions Package.resolved # Ignore docs generated by SourceKitten diff --git a/Sources/Common/Container/ContainerEntryType.swift b/Sources/Common/Container/ContainerEntryType.swift index c5e73600..24fe14b0 100644 --- a/Sources/Common/Container/ContainerEntryType.swift +++ b/Sources/Common/Container/ContainerEntryType.swift @@ -28,6 +28,7 @@ public enum ContainerEntryType { /// Entry type is unknown. case unknown + /// This initalizer's semantics assume conversion from UNIX type, which, by definition, doesn't have `unknown` type. init?(_ unixType: UInt32) { switch unixType { case 0o010000: diff --git a/Sources/swcomp/Extensions/ContainerEntryInfo+CustomStringConvertible.swift b/Sources/swcomp/Extensions/ContainerEntryInfo+CustomStringConvertible.swift index facfd02d..919d328e 100644 --- a/Sources/swcomp/Extensions/ContainerEntryInfo+CustomStringConvertible.swift +++ b/Sources/swcomp/Extensions/ContainerEntryInfo+CustomStringConvertible.swift @@ -9,8 +9,7 @@ import SWCompression extension ContainerEntryInfo where Self: CustomStringConvertible { public var description: String { - var output = "" - output += "Name: \(self.name)\n" + var output = "Name: \(self.name)\n" switch self.type { case .blockSpecial: diff --git a/Sources/swcomp/Extensions/GzipHeader+CustomStringConvertible.swift b/Sources/swcomp/Extensions/GzipHeader+CustomStringConvertible.swift index a718f343..166cc6cf 100644 --- a/Sources/swcomp/Extensions/GzipHeader+CustomStringConvertible.swift +++ b/Sources/swcomp/Extensions/GzipHeader+CustomStringConvertible.swift @@ -9,10 +9,12 @@ import SWCompression extension GzipHeader: CustomStringConvertible { public var description: String { - var output = "" - output += "File name: \(self.fileName ?? "")\n" - output += "File system type: \(self.osType)\n" - output += "Compression method: \(self.compressionMethod)\n" + var output = """ + File name: \(self.fileName ?? "") + File system type: \(self.osType) + Compression method: \(self.compressionMethod) + + """ if let mtime = self.modificationTime { output += "Modification time: \(mtime)\n" }