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 afdccdb
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 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
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 afdccdb

Please sign in to comment.