Skip to content

Conversation

@MaxDesiatov
Copy link
Member

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.

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.
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think @_disfavoredOverload should be needed here.

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.

2 participants