Skip to content

Commit

Permalink
Reuse String -> URL convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
dfed committed Jan 1, 2025
1 parent 2fdaedc commit 5574ca4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Sources/SafeDITool/SafeDITool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,7 @@ struct SafeDITool: AsyncParsableCommand, Sendable {

extension Data {
fileprivate func write(toPath filePath: String) throws {
#if os(Linux)
try write(to: URL(fileURLWithPath: filePath))
#else
if #available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) {
try write(to: URL(filePath: filePath))
} else {
try write(to: URL(fileURLWithPath: filePath))
}
#endif
try write(to: filePath.asFileURL)
}
}

Expand Down

0 comments on commit 5574ca4

Please sign in to comment.