Skip to content

Commit 4015fa0

Browse files
committed
make NoAllocSliceSegments a special case of NoAllocBufferSegments
1 parent de05670 commit 4015fa0

File tree

2 files changed

+113
-222
lines changed

2 files changed

+113
-222
lines changed

capnp/src/serialize.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
//! [standard stream framing](https://capnproto.org/encoding.html#serialization-over-a-stream),
2424
//! where each message is preceded by a segment table indicating the size of its segments.
2525
26-
mod no_alloc_slice_segments;
27-
pub use no_alloc_slice_segments::{NoAllocBufferSegments, NoAllocSliceSegments};
26+
mod no_alloc_buffer_segments;
27+
pub use no_alloc_buffer_segments::{NoAllocBufferSegments, NoAllocSliceSegments};
2828

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

100100
Ok(message::Reader::new(segments, options))
101101
}

0 commit comments

Comments
 (0)