Skip to content

Commit ba325c3

Browse files
adam-fowlerktoso
andauthored
If FoundationEssentials is available use it (#158)
Use FoundationEssentials if it is available ### Motivation: Reduce size of any application using swift-metrics on linux --------- Co-authored-by: Konrad `ktoso` Malawski <konrad_malawski@apple.com> Co-authored-by: Konrad `ktoso` Malawski <konrad.malawski@project13.pl>
1 parent e2951c3 commit ba325c3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/Metrics/Metrics.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@
1616
// https://github.com/swiftlang/swift/issues/79285
1717

1818
@_exported import CoreMetrics
19-
import Foundation
20-
2119
@_exported import class CoreMetrics.Timer
2220

21+
#if canImport(FoundationEssentials)
22+
import FoundationEssentials
23+
#else
24+
import Foundation
25+
#endif
26+
2327
#if canImport(Dispatch)
2428
import Dispatch
2529

0 commit comments

Comments
 (0)