Skip to content

Commit

Permalink
Use FoundationEssentials where possible
Browse files Browse the repository at this point in the history
Motivation:

FoundationEssentials only includes ... the essentials. We should use it
where available.

Modifications:

- Remove unused Foundation imports
- Replace a Foundation import with a FoundationEssentials import

Result:

Smaller dependency set
  • Loading branch information
glbrntt committed Dec 17, 2024
1 parent fd197ad commit cf8a876
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Sources/GRPCProtobufCodeGen/ProtobufCodeGenParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

internal import Foundation
internal import SwiftProtobuf
package import SwiftProtobufPluginLibrary

Expand All @@ -25,6 +24,12 @@ package import struct GRPCCodeGen.Name
package import struct GRPCCodeGen.ServiceDescriptor
package import struct GRPCCodeGen.SourceGenerator

#if canImport(FoundationEssentials)
internal import struct FoundationEssentials.IndexPath
#else
internal import struct Foundation.IndexPath
#endif

/// Parses a ``FileDescriptor`` object into a ``CodeGenerationRequest`` object.
package struct ProtobufCodeGenParser {
let extraModuleImports: [String]
Expand Down
1 change: 0 additions & 1 deletion Sources/protoc-gen-grpc-swift/GenerateGRPC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import Foundation
import GRPCCodeGen
import GRPCProtobufCodeGen
import SwiftProtobuf
Expand Down
2 changes: 1 addition & 1 deletion Sources/protoc-gen-grpc-swift/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Foundation

import SwiftProtobufPluginLibrary

enum GenerationError: Error {
Expand Down

0 comments on commit cf8a876

Please sign in to comment.