Overload plainHexEncoded methods for some StringProtocol#3434
Open
MaxDesiatov wants to merge 2 commits intoapple:mainfrom
Open
Overload plainHexEncoded methods for some StringProtocol#3434MaxDesiatov wants to merge 2 commits intoapple:mainfrom
plainHexEncoded methods for some StringProtocol#3434MaxDesiatov wants to merge 2 commits intoapple:mainfrom
Conversation
These methods currently don't accept `Substring` arguments, which means that users need to manually convert to `String`. Let's add `some StringProtocol`-accepting overloads that allow this.
Lukasa
requested changes
Nov 3, 2025
Contributor
Lukasa
left a comment
There was a problem hiding this comment.
This is a reasonable overload request, thanks. I've left some notes in the diff, but we'll also need tests for the new API surface.
| /// - plainHexEncodedBytes: The hex encoded string to write. Plain hex dump format is hex bytes optionally separated by spaces, i.e. `48 65 6c 6c 6f` or `48656c6c6f` for `Hello`. | ||
| /// This format is compatible with `xxd` CLI utility. | ||
| /// - Returns: The number of bytes written. | ||
| @_disfavoredOverload |
Contributor
There was a problem hiding this comment.
I don't think @_disfavoredOverload should be needed here.
| /// This will allocate a new `ByteBuffer` with enough space to fit `bytes` and potentially some extra space. | ||
| /// | ||
| /// - Returns: The `ByteBuffer` containing the written bytes. | ||
| @_disfavoredOverload |
Contributor
There was a problem hiding this comment.
I don't think @_disfavoredOverload should be needed here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These methods currently don't accept
Substringarguments, which means that users need to manually convert toString. Let's addsome StringProtocol-accepting overloads that allow this.