Skip to content

Commit

Permalink
Remove unused Foundation imports
Browse files Browse the repository at this point in the history
Motivation:

A few files unnecesarily import Foundation

Modifications:

Remove unused imports

Result:

Fewer dependencies
  • Loading branch information
glbrntt committed Dec 17, 2024
1 parent 13150bd commit 96e3e58
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
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

0 comments on commit 96e3e58

Please sign in to comment.