-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Remove use of NSString.replacingOccurrences(of:with:)
#6650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci please test |
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
Not sure if it makes more sense to add |
nice, thanks! |
@MaxDesiatov I have the same concern about the frequency of this, and a call to |
@MaxDesiatov is there a good way to annotate the availability? Ideally we could use the same path on macOS as well 😞 |
Since this is for |
@neonichu oh? That really would be my preference. |
@swift-ci smoke test |
@swift-ci test windows |
@swift-ci please test Windows platform |
Actually, I think the CI is using macOS 12, so that would have to be updated before we can upgrade the deployment target :/ |
@compnerd maybe add availability check, then we can deprecate the old path when we can raise the min target |
@compnerd do you want to take this forward, or close? |
I think that if we can get this sorted out, it is better. IMO, we should lean on the standard library wherever feasible. |
agreed - I think that can be achieved by changing the package min deployment platform back to 12 and adding inline availability checks until we can raise the min deployment target |
Package.swift
Outdated
@@ -69,7 +69,7 @@ let autoProducts = [swiftPMProduct, swiftPMDataModelProduct] | |||
let package = Package( | |||
name: "SwiftPM", | |||
platforms: [ | |||
.macOS(.v12), | |||
.macOS(.v13), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also update iOS version to v16
for alignment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM. But I was wondering whether it is the appropriate time to bump the minimal version.
See #6598 (comment)
-1 for this. It seems just increase the code complexity. I'd suggest we merge this after we can safely bump the minimal corresponding OS version. |
that may take a while which means this will bit rot. the increased complexity is a good argument, but its a tradeoff |
@swift-ci please test |
Prefer to use `String.replacing(_:with:)` instead of the `NSString` operations for the strings. This should avoid an unnecessary use of Foundation API and a dispatch to the `NSString` API. Bump the minimum platform version to 10.13 to deal with the API availability in the standard library.
@swift-ci please test |
@swift-ci please test windows |
Prefer to use
String.replacing(_:with:)
instead of theNSString
operations for the strings. This should avoid an unnecessary use of Foundation API and a dispatch to theNSString
API.