diff --git a/Sources/GRPCCodeGen/CodeGenerationRequest.swift b/Sources/GRPCCodeGen/CodeGenerationRequest.swift index fbe545dbe..5106b3c58 100644 --- a/Sources/GRPCCodeGen/CodeGenerationRequest.swift +++ b/Sources/GRPCCodeGen/CodeGenerationRequest.swift @@ -14,8 +14,6 @@ * limitations under the License. */ -import Foundation - /// Describes the services, dependencies and trivia from an IDL file, /// and the IDL itself through its specific serializer and deserializer. public struct CodeGenerationRequest { diff --git a/Sources/GRPCCodeGen/Internal/Renderer/TextBasedRenderer.swift b/Sources/GRPCCodeGen/Internal/Renderer/TextBasedRenderer.swift index c7c6f3850..0900169c0 100644 --- a/Sources/GRPCCodeGen/Internal/Renderer/TextBasedRenderer.swift +++ b/Sources/GRPCCodeGen/Internal/Renderer/TextBasedRenderer.swift @@ -26,7 +26,6 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -import Foundation /// An object for building up a generated file line-by-line. /// diff --git a/Sources/GRPCCodeGen/Internal/Translator/Docs.swift b/Sources/GRPCCodeGen/Internal/Translator/Docs.swift index c0017e293..f8c6def00 100644 --- a/Sources/GRPCCodeGen/Internal/Translator/Docs.swift +++ b/Sources/GRPCCodeGen/Internal/Translator/Docs.swift @@ -14,8 +14,6 @@ * limitations under the License. */ -import Foundation - package enum Docs { package static func suffix(_ header: String, withDocs footer: String) -> String { if footer.isEmpty { @@ -58,7 +56,9 @@ package enum Docs { """ let body = docs.split(separator: "\n").map { line in - "/// > " + line.dropFirst(4).trimmingCharacters(in: .whitespaces) + var line = "/// > " + line.dropFirst(4) + line.trimPrefix(while: { $0.isWhitespace }) + return String(line.drop(while: { $0.isWhitespace })) }.joined(separator: "\n") return header + "\n" + body diff --git a/Sources/GRPCCodeGen/Internal/TypeName.swift b/Sources/GRPCCodeGen/Internal/TypeName.swift index 0152de6a0..35d5eb77a 100644 --- a/Sources/GRPCCodeGen/Internal/TypeName.swift +++ b/Sources/GRPCCodeGen/Internal/TypeName.swift @@ -26,7 +26,6 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -import Foundation /// A fully-qualified type name that contains the components of the Swift /// type name.