Skip to content

Commit

Permalink
Fix code fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Mar 15, 2024
1 parent 53b36c5 commit 4d2d54c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions commons/zenoh-codec/src/core/zint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,19 @@ where
// the maximum number of bytes a VLE can take once encoded.
// I.e.: x is shifted 7 bits to the right every iteration,
// the loop is at most VLE_LEN iterations.
unsafe { *buffer.get_unchecked_mut(len) = (x as u8) | 0x80; }
unsafe {
*buffer.get_unchecked_mut(len) = (x as u8) | 0x80;
}
len += 1;
x >>= 7;
}
// SAFETY: buffer is guaranteed to be VLE_LEN long where VLE_LEN is
// the maximum number of bytes a VLE can take once encoded.
// I.e.: x is shifted 7 bits to the right every iteration,
// the loop is at most VLE_LEN iterations.
unsafe { *buffer.get_unchecked_mut(len) = x as u8; }
unsafe {
*buffer.get_unchecked_mut(len) = x as u8;
}
len + 1
})?;
Ok(())
Expand Down

0 comments on commit 4d2d54c

Please sign in to comment.