Skip to content
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

Apply if let shorthand syntax #762

Merged
merged 2 commits into from
Mar 7, 2024
Merged

Apply if let shorthand syntax #762

merged 2 commits into from
Mar 7, 2024

Conversation

mlight3
Copy link

@mlight3 mlight3 commented Mar 6, 2024

if let shorthand syntax was introduced since swift 5.7. (SE-3045)

I replace codes by using following regexs.

regex replacement
if let (.+)? = \1 { if let $1 {
if let (.+)? = \1, if let $1,
if let (.+)? = self.\1 { if let $1 {
if let (.+)? = self.\1, if let $1,

@kean
Copy link
Owner

kean commented Mar 6, 2024

Nice work, thank you @mlight3.

I noticed there is also at least one var that hasn't been updated, in case you'd want to tackle it as well:

guard var request = request else {

@mlight3
Copy link
Author

mlight3 commented Mar 7, 2024

Hi ,@kean

Thank you for the review.
I also replaced guard statement in this commit

@mlight3 mlight3 force-pushed the mlight3/swift-5.7 branch from 2b32e67 to 36b5836 Compare March 7, 2024 01:11
@kean kean merged commit 058bf6c into kean:main Mar 7, 2024
8 checks passed
@mlight3 mlight3 deleted the mlight3/swift-5.7 branch March 7, 2024 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants