mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-06 15:27:28 +00:00
[Protocol] Add buffer comment to refactor at some point remaining_bytes
This commit is contained in:
parent
9d8fb1ba94
commit
071fc367df
2 changed files with 4 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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>> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue