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

Shorthand Optional Binding #125

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

avbangar
Copy link
Contributor

@avbangar avbangar commented Feb 2, 2023

Issue number of the reported bug or feature request: #124

Describe your changes:

  • shorthand optional binding functionality arrived in Swift 5.7.
  • making use of this shorthand will increase the readability of the codebase.
  • this PR replaces the current uses of the long form.

Example:

let foo: FooType? = ...

if let foo = foo {
    ...
}

Can now be shortened to:

let foo: FooType? = ...

if let foo {
    ...
}

This also works for guard let, if var, etc.

Testing performed:

Ran the tests provided using swift test.

@avbangar avbangar marked this pull request as ready for review February 2, 2023 21:37
@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Base: 96.71% // Head: 96.71% // No change to project coverage 👍

Coverage data is based on head (6279ee0) compared to base (289872e).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #125   +/-   ##
=======================================
  Coverage   96.71%   96.71%           
=======================================
  Files          50       50           
  Lines        2773     2773           
=======================================
  Hits         2682     2682           
  Misses         91       91           
Impacted Files Coverage Δ
Sources/XCDiffCommand/CommandRunner.swift 97.36% <100.00%> (ø)
...es/XCDiffCore/Comparator/CopyFilesComparator.swift 99.28% <100.00%> (ø)
...XCDiffCore/Comparator/DependenciesComparator.swift 97.80% <100.00%> (ø)
...ffCore/Comparator/ResolvedSettingsComparator.swift 98.75% <100.00%> (ø)
...es/XCDiffCore/Comparator/RunScriptComparator.swift 100.00% <100.00%> (ø)
...e/Library/Descriptors/SwiftPackageDescriptor.swift 89.65% <100.00%> (ø)
...es/XCDiffCore/Library/SettingValueComparator.swift 100.00% <100.00%> (ø)
Sources/XCDiffCore/Library/SettingsHelper.swift 94.33% <100.00%> (ø)
...iffCore/ResultRenderer/Renderer/HTMLRenderer.swift 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

kwridan
kwridan previously approved these changes Feb 7, 2023
Copy link
Contributor

@kwridan kwridan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing this @avbangar

Can we trouble you to re-submit with a signed commit?

Some more details on why this is needed can be found here:
https://github.com/bloomberg/.github/blob/master/CONTRIBUTING.md#contribution-licensing

Signed-off-by: Aakash Bangar <aakash.bangar@aexp.com>
@avbangar
Copy link
Contributor Author

avbangar commented Feb 7, 2023

Sure thing @kwridan! I'm not really sure why but my original commit message was signed with my alternative email address 🤔

I think it's fixed now though:

Screenshot 2023-02-07 at 09 34 24

Copy link
Contributor

@kwridan kwridan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for the updates!

@kwridan kwridan merged commit 16f3eb8 into bloomberg:main Feb 7, 2023
@avbangar avbangar deleted the shorthand-optional-binding branch February 7, 2023 10:56
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.

None yet

2 participants