[Protocol] Add buffer comment to refactor at some point remaining_bytes

This commit is contained in:
CosminPerRam 2023-08-15 21:36:40 +03:00
parent 9d8fb1ba94
commit 071fc367df
2 changed files with 4 additions and 3 deletions

View file

@ -46,8 +46,9 @@ impl<'a, B: ByteOrder> Buffer<'a, B> {
/// Returns the length of the buffer data.
pub const fn data_length(&self) -> usize { self.data.len() }
// Added for legacy support just for the refactoring
// Not Tested
// TODO: Look into this to make it take ownership of data, not borrowing it
// There are many instances where we transform this to a vector.
/// Returns the remaining bytes that have not been read.
pub fn remaining_bytes(&self) -> &[u8] { &self.data[self.cursor ..] }
/// Moves the cursor forward or backward by a specified offset.

View file

@ -45,7 +45,7 @@ fn get_data<Client: QuakeClient>(address: &SocketAddr, timeout_settings: Option<
bufferer.move_cursor(response_header.len() as isize)?;
Ok(bufferer.remaining_bytes().to_vec()) //TODO: Maybe fix?
Ok(bufferer.remaining_bytes().to_vec())
}
fn get_server_values(bufferer: &mut Buffer<LittleEndian>) -> GDResult<HashMap<String, String>> {