comment out unused packet methods

This commit is contained in:
Zoey 2024-04-19 13:17:40 -07:00
parent d56bf8b7e4
commit 8bdb6e4ee5
No known key found for this signature in database
GPG key ID: 8611B896D1AAFAF2

View file

@ -62,27 +62,27 @@ impl<'p> PacketReader<'p> {
Some(String::from_iter(chars).trim().to_string()) Some(String::from_iter(chars).trim().to_string())
} }
/// gets the next array of the given length in the packet, if any // /// gets the next array of the given length in the packet, if any
fn next_array_of_length(&mut self, len: usize) -> Option<Vec<u8>> { // fn next_array_of_length(&mut self, len: usize) -> Option<Vec<u8>> {
let mut bytes: Vec<u8> = Vec::new(); // let mut bytes: Vec<u8> = Vec::new();
let mut append = true; // let mut append = true;
for _ in 0..len { // for _ in 0..len {
let b = self.next_u8()?; // let b = self.next_u8()?;
if append { // if append {
if b == 0 { // if b == 0 {
append = false; // append = false;
} else { // } else {
bytes.push(b); // bytes.push(b);
} // }
} // }
} // }
Some(bytes) // Some(bytes)
} // }
/// gets the next array of default size in the packet, if any // /// gets the next array of default size in the packet, if any
fn next_array(&mut self) -> Option<Vec<u8>> { // fn next_array(&mut self) -> Option<Vec<u8>> {
self.next_array_of_length(ARRAY_LENGTH) // self.next_array_of_length(ARRAY_LENGTH)
} // }
} }
/// helper for writing a packet /// helper for writing a packet