Skip to content

Commit

Permalink
make NoAllocSliceSegments a special case of NoAllocBufferSegments
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Aug 21, 2023
1 parent de05670 commit 4015fa0
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 222 deletions.
6 changes: 3 additions & 3 deletions capnp/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
//! [standard stream framing](https://capnproto.org/encoding.html#serialization-over-a-stream),
//! where each message is preceded by a segment table indicating the size of its segments.

mod no_alloc_slice_segments;
pub use no_alloc_slice_segments::{NoAllocBufferSegments, NoAllocSliceSegments};
mod no_alloc_buffer_segments;
pub use no_alloc_buffer_segments::{NoAllocBufferSegments, NoAllocSliceSegments};

#[cfg(feature = "alloc")]
use crate::io::{Read, Write};
Expand Down Expand Up @@ -95,7 +95,7 @@ pub fn read_message_from_flat_slice_no_alloc<'a>(
slice: &mut &'a [u8],
options: message::ReaderOptions,
) -> Result<message::Reader<NoAllocSliceSegments<'a>>> {
let segments = NoAllocSliceSegments::try_new(slice, options)?;
let segments = NoAllocSliceSegments::from_slice(slice, options)?;

Ok(message::Reader::new(segments, options))
}
Expand Down
Loading

0 comments on commit 4015fa0

Please sign in to comment.