Skip to content

Commit 1a70790

Browse files
committed
Address some comments
1 parent 7b3d122 commit 1a70790

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

alvr/sockets/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ mod stream_socket;
44
use alvr_common::{ConResult, HandleTryAgain, anyhow::Result, info};
55
use alvr_session::{DscpTos, SocketBufferSize};
66
use socket2::Socket;
7-
#[cfg(not(windows))]
87
use std::ffi::c_int;
98
use std::{
109
mem::MaybeUninit,

alvr/sockets/src/stream_socket/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ impl<H> Buffer<H> {
8686
&self.inner[self.raw_payload_offset..]
8787
}
8888

89-
/// If the range is outside the valid range, new space will be allocated
89+
/// The buffer starts with no raw payload allocated space. If the range is outside the valid
90+
/// range, new space will be allocated
9091
/// NB: the offset parameter is applied on top of the internal offset of the buffer
9192
#[must_use]
9293
pub fn get_range_mut(&mut self, range: Range<usize>) -> &mut [u8] {
@@ -95,7 +96,7 @@ impl<H> Buffer<H> {
9596
self.inner.resize(required_size, 0);
9697
}
9798

98-
&mut self.inner[self.raw_payload_offset + range.start..][..range.end]
99+
&mut self.inner[self.raw_payload_offset..][range]
99100
}
100101

101102
/// If length > current length, allocate more space

0 commit comments

Comments
 (0)