-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[gardening] Use optional binding #1358
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 |
These look good to me. What do you think @phausler ? Do we need to update similar things elsewhere e.g. in overlays? |
TestFoundation/TestStream.swift
Outdated
let testFile = createTestFile("testFile_in.txt", _contents: messageData) | ||
if testFile != nil { | ||
let url = URL(fileURLWithPath: testFile!) | ||
if let testFile = createTestFile("testFile_in.txt", _contents: messageData) { |
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.
While these are all improvements, I think perhaps we could do better:
guard let testFile = createTestFile("testFile_in.txt", _contents: messageData) else {
XCTFail("Unable to create temp file")
return
}
...
guard
is great for reducing the indentation and putting failure code near the test.
Submitted swiftlang/swift#13314 for some overlays. |
yea, we should keep the overlays and swift-corelibs-foundation in sync. the change looks reasonable to me (however I didnt really get a chance to go over it in detail but it seems rather mechanical and isomorphic) |
@swift-ci test and merge |
@swift-ci Please test and merge |
1 similar comment
@swift-ci Please test and merge |
682c6b1
to
a4fb766
Compare
@swift-ci test and merge |
1 similar comment
@swift-ci test and merge |
No description provided.