Skip to content

Conversation

@sophokles73
Copy link
Contributor

Adapted constructor to accept any payload that is Into.

Adapted constructor to accept any payload that is Into<Bytes>.
@sophokles73 sophokles73 requested a review from evshary August 21, 2024 15:26
@sophokles73 sophokles73 added the enhancement New feature or request label Aug 21, 2024
@sophokles73 sophokles73 requested a review from PLeVasseur August 22, 2024 11:17
Copy link
Contributor

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

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

LGTM

/// assert_eq!(payload.payload_format(), UPayloadFormat::UPAYLOAD_FORMAT_RAW);
/// assert_eq!(payload.payload().len(), 3);
/// ```
pub fn new<T: Into<Bytes>>(payload: T, payload_format: UPayloadFormat) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, allows us to accept Bytes as well as anything which can be turned into Bytes.

@sophokles73 sophokles73 merged commit c109a53 into eclipse-uprotocol:main Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants