Skip to content

Conversation

@birneee
Copy link
Contributor

@birneee birneee commented Dec 18, 2025

No description provided.

@birneee birneee requested a review from a team as a code owner December 18, 2025 14:53

match socket.send_to(&buf[off..off + pkt_len], send_info.to) {
for chunk in buf.chunks(segment_size) {
match socket.send_to(&chunk, send_info.to) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice simplification. Please see CI failures due to compile warnings:

error: unused import: `std::cmp`
  --> apps/src/sendto.rs:27:5
   |
27 | use std::cmp;

let pkt_len = cmp::min(left, segment_size);

match socket.send_to(&buf[off..off + pkt_len], send_info.to) {
for chunk in buf.chunks(segment_size) {
Copy link
Contributor

Choose a reason for hiding this comment

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

According to rustdocs, Segment_size 0 will panic. We should probably have an earlier check for that. The lack of check in the old code would be a problem too but would manifest differently

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