Skip to content

Commit cf8a876

Browse files
committed
Use FoundationEssentials where possible
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
1 parent fd197ad commit cf8a876

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Sources/GRPCProtobufCodeGen/ProtobufCodeGenParser.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
internal import Foundation
1817
internal import SwiftProtobuf
1918
package import SwiftProtobufPluginLibrary
2019

@@ -25,6 +24,12 @@ package import struct GRPCCodeGen.Name
2524
package import struct GRPCCodeGen.ServiceDescriptor
2625
package import struct GRPCCodeGen.SourceGenerator
2726

27+
#if canImport(FoundationEssentials)
28+
internal import struct FoundationEssentials.IndexPath
29+
#else
30+
internal import struct Foundation.IndexPath
31+
#endif
32+
2833
/// Parses a ``FileDescriptor`` object into a ``CodeGenerationRequest`` object.
2934
package struct ProtobufCodeGenParser {
3035
let extraModuleImports: [String]

Sources/protoc-gen-grpc-swift/GenerateGRPC.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import Foundation
1817
import GRPCCodeGen
1918
import GRPCProtobufCodeGen
2019
import SwiftProtobuf

Sources/protoc-gen-grpc-swift/Options.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import Foundation
16+
1717
import SwiftProtobufPluginLibrary
1818

1919
enum GenerationError: Error {

0 commit comments

Comments
 (0)