websocket-kit
websocket-kit copied to clipboard
Changed type of send(_ binary:) from `[UInt8]` to `some DataProtocol`
This allows for passing in Data or ByteBufferView to send(_:), as well as the currently-supported [UInt8] type.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 82.85%. Comparing base (
a935b63) to head (8d2d799). Report is 2 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #146 +/- ##
=======================================
Coverage 82.85% 82.85%
=======================================
Files 6 6
Lines 659 659
=======================================
Hits 546 546
Misses 113 113
| Files | Coverage Δ | |
|---|---|---|
| Sources/WebSocketKit/WebSocket.swift | 89.04% <100.00%> (ø) |
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.
Regarding the failing test, it reacts to the change of type. But since [UInt8] conforms to DataProtocol (which for the record is protocol DataProtocol : RandomAccessCollection where Self.Element == UInt8, Self.SubSequence : DataProtocol), I am not sure it actually is a breaking change?
Why wasn't this changed in the Concurrency shims as well?
https://github.com/vapor/websocket-kit/blob/4232d34efa49f633ba61afde365d3896fc7f8740/Sources/WebSocketKit/Concurrency/WebSocket%2BConcurrency.swift#L15
Probably just an oversight tbh
Why wasn't this changed in the Concurrency shims as well?
https://github.com/vapor/websocket-kit/blob/4232d34efa49f633ba61afde365d3896fc7f8740/Sources/WebSocketKit/Concurrency/WebSocket%2BConcurrency.swift#L15
I didn't know that overload existed until you told me about it. I stumbled on the one I changed and didn't look further as it did what I wanted 🤷.