Skip to content

Commit

Permalink
fix InOutBufReserved::from_mut_slice
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Feb 8, 2022
1 parent 754fe46 commit 7c06087
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inout/src/reserved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct InOutBufReserved<'inp, 'out, T> {
impl<'a, T> InOutBufReserved<'a, 'a, T> {
/// Crate [`InOutBufReserved`] from a single mutable slice.
pub fn from_mut_slice(buf: &'a mut [T], msg_len: usize) -> Result<Self, OutIsTooSmallError> {
if buf.len() > msg_len {
if msg_len > buf.len() {
return Err(OutIsTooSmallError);
}
let out_ptr = buf.as_mut_ptr();
Expand Down

0 comments on commit 7c06087

Please sign in to comment.