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

Fix unused result warning for defer example #158

Merged
merged 2 commits into from
Jul 25, 2023
Merged

Conversation

ishaanbedi
Copy link
Contributor

Fix unused result warning for defer example in GuidedTour.md for Guided Tour Section

Fixes: #157

Fix unused result warning for `defer` example in GuidedTour.md for Guided Tour Section
Match the print() message to other nearby phrasing.

No need to assign the value returned from calling fridgeContains() to a
constant, since it's used only once.
@amartini51
Copy link
Collaborator

Tested the existing version in a playground, the Swift REPL, and calling swift on the command line with a file. I see a warning only in the last case. That's a valid way to read the guided tour, but I wouldn't expect it to be the most common.

Confirmed that the revised version of the code looks ok in all three places.

@ishaanbedi I pushed a commit to your branch with some minor changes. How does that look to you?

@ishaanbedi
Copy link
Contributor Author

@ishaanbedi I pushed a commit to your branch with some minor changes. How does that look to you?

Looks good to me. Addresses the issue correctly.

@amartini51 amartini51 merged commit 2c6b09c into apple:main Jul 25, 2023
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.

The defer example in A Swift Tour page produces a warning
2 participants