Skip to content

Force-unwrap an optional so we print the value without Optional("..."). #376

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

Closed
wants to merge 1 commit into from
Closed

Force-unwrap an optional so we print the value without Optional("..."). #376

wants to merge 1 commit into from

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented May 28, 2016

Small fix for an issue I noticed while using swift-build --clean.

@@ -303,7 +303,7 @@ enum CleanMode: CustomStringConvertible {
case "dist"?, "distribution"?:
self = .dist
default:
throw OptionParserError.invalidUsage("invalid clean mode: \(rawValue)")
throw OptionParserError.invalidUsage("invalid clean mode: \(rawValue!)")
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't rawValue ?? "nil" be better in case someone ends up removing nil from switch case

@ddunbar
Copy link
Contributor

ddunbar commented May 28, 2016

Thanks Mark! Landed alternate version in b4c7c98

@ddunbar ddunbar closed this May 28, 2016
@rudkx rudkx deleted the fix-optional-interpolation branch June 1, 2016 04:10
aciidgh pushed a commit to aciidgh/swift-package-manager that referenced this pull request Jan 11, 2019
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.

3 participants