Skip to content

Conversation

@lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Jan 28, 2025

No description provided.

@ilo-nanpa
Copy link
Contributor

ilo-nanpa bot commented Jan 28, 2025

it seems like you haven't added any nanpa changeset files to this PR.

if this pull request includes changes to code, make sure to add a changeset, by writing a file to .nanpa/<unique-name>.kdl:

minor type="added" "Introduce frobnication algorithm"

refer to the manpage for more information.

options: SendDataOptions,
) -> ServiceResult<()> {
let mut rng = rand::rng();
let nonce: Vec<u8> = (0..16).map(|_| rng.random::<u8>()).collect();
Copy link
Member

Choose a reason for hiding this comment

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

nit, you could easily avoid heap allocation
let mut nonce = [0u8; 16];

Copy link
Contributor Author

@lukasIO lukasIO Jan 28, 2025

Choose a reason for hiding this comment

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

had this initially with rnd:fill(arr) but this required .to_vec() which copies everything into the vec. I guess it would still do heap allocation at the time of copying it into the vec?

Copy link
Member

Choose a reason for hiding this comment

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

ah yeah, seems unnecessary then

@lukasIO lukasIO merged commit 370d2ac into main Jan 28, 2025
6 checks passed
@lukasIO lukasIO deleted the lukas/data-nonce branch January 28, 2025 12:53
rileyseaburg pushed a commit to Evolving-Software/livekit-rust-sdks that referenced this pull request Feb 19, 2025
* Update protocol and add SendDataRequest nonce

* changeset

* typo
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.

3 participants