Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Sources/GRPCCodeGen/CodeGenerationRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -334,7 +332,7 @@ extension Name {
///
/// For example, if `base` is "Foo.Bar", then `normalizedBase` is "Foo_Bar".
public var normalizedBase: String {
return self.base.replacingOccurrences(of: ".", with: "_")
return self.base.replacing(".", with: "_")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import Foundation

/// An object for building up a generated file line-by-line.
///
Expand Down
6 changes: 3 additions & 3 deletions Sources/GRPCCodeGen/Internal/Translator/Docs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion Sources/GRPCCodeGen/Internal/TypeName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading