Skip to content

[Basic] Use UInt8 as the native process output type. #1812

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

Merged
merged 2 commits into from
Oct 14, 2018

Conversation

ddunbar
Copy link
Contributor

@ddunbar ddunbar commented Oct 14, 2018

  • Using Int8 is weird. Also, throwing on non-UTF8 sequences is so Swift 2, it
    is much cleaner to just use the newer conversion methods.

 - Using Int8 is weird. Also, throwing on non-UTF8 sequences is so Swift 2, it
   is much cleaner to just use the newer conversion methods.
@ddunbar ddunbar requested a review from aciidgh October 14, 2018 04:14
@ddunbar ddunbar added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Oct 14, 2018
@ddunbar
Copy link
Contributor Author

ddunbar commented Oct 14, 2018

@swift-ci please smoke test

let outputs: [String] = output.split(separator: 0).map(Array.init).map({ (bytes: [Int8]) -> String in
return String(cString: bytes + [0])
})
let outputs: [String] = output.split(separator: 0).map{ String(decoding: $0, as: Unicode.UTF8.self) }
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: The Rule of Kevin

let outputs: [String] = output.split(separator: 0).map({ String(decoding: $0, as: Unicode.UTF8.self) })

@aciidgh
Copy link
Contributor

aciidgh commented Oct 14, 2018

@swift-ci please smoke test

@ddunbar ddunbar merged commit 961d9fa into swiftlang:master Oct 14, 2018
@ddunbar ddunbar deleted the process-result-is-uint8 branch October 14, 2018 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants