Code format using `cargo fmt`

master
luojia65 2021-10-27 16:35:05 +08:00
parent a714def8d0
commit c111bee3b6
3 changed files with 4 additions and 3 deletions

View File

@ -1875,7 +1875,8 @@ impl<'a> TcpSocket<'a> {
payload_len, payload_len,
payload_offset payload_offset
); );
let len_written = self.rx_buffer let len_written = self
.rx_buffer
.write_unallocated(payload_offset, repr.payload); .write_unallocated(payload_offset, repr.payload);
debug_assert!(len_written == payload_len); debug_assert!(len_written == payload_len);
} }

View File

@ -102,7 +102,7 @@ impl<'a, H> PacketBuffer<'a, H> {
// Add padding to the end of the ring buffer so that the // Add padding to the end of the ring buffer so that the
// contiguous window is at the beginning of the ring buffer. // contiguous window is at the beginning of the ring buffer.
*self.metadata_ring.enqueue_one()? = PacketMetadata::padding(contig_window); *self.metadata_ring.enqueue_one()? = PacketMetadata::padding(contig_window);
// note(discard): function does not write to the result // note(discard): function does not write to the result
// enqueued padding buffer location // enqueued padding buffer location
let _buf_enqueued = self.payload_ring.enqueue_many(contig_window); let _buf_enqueued = self.payload_ring.enqueue_many(contig_window);
} }

View File

@ -1,4 +1,4 @@
// Some of the functions in ring buffer is marked as #[must_use]. It notes that // Some of the functions in ring buffer is marked as #[must_use]. It notes that
// these functions may have side effects, and it's implemented by [RFC 1940]. // these functions may have side effects, and it's implemented by [RFC 1940].
// [RFC 1940]: https://github.com/rust-lang/rust/issues/43302 // [RFC 1940]: https://github.com/rust-lang/rust/issues/43302