Skip to content

Commit

Permalink
put_short fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ismaileke committed Aug 25, 2024
1 parent 27ea147 commit 597f138
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,8 @@ pub mod binary {
}

pub fn put_short(&mut self, value: u16) {
let short_bytes: [u8; 2] = value.to_le_bytes();
self.buffer.push(short_bytes[0]);
self.buffer.push(short_bytes[1]);
self.buffer.push((value >> 8) as u8);
self.buffer.push((value & 0xFF) as u8);
}

pub fn get_l_short(&mut self) -> u16 {
Expand Down

0 comments on commit 597f138

Please sign in to comment.