Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoljub-duric committed Mar 12, 2024
1 parent ef11178 commit 432058f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/storable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,19 +692,19 @@ fn encode_tuple_element<T: Storable>(dst: &mut [u8], bytes: &[u8], last: bool) -
fn decode_tuple_element<T: Storable>(src: &[u8], size_len: Option<u8>, last: bool) -> (T, usize) {
let mut bytes_read: usize = 0;

let size = if last {
src.len()
let size = if let Some(size_len) = size_len {
let size = decode_size(&src[bytes_read..], size_len as usize);
bytes_read += size_len as usize;
size
} else if let Bound::Bounded {
max_size,
is_fixed_size: true,
} = T::BOUND
{
max_size as usize
} else {
let size_len = size_len.unwrap() as usize;
let size = decode_size(&src[bytes_read..], size_len);
bytes_read += size_len;
size
assert!(last);
src.len()
};

(
Expand Down

0 comments on commit 432058f

Please sign in to comment.