summaryrefslogtreecommitdiff
path: root/rust/zerocopy/benches/read_from_prefix.rs
blob: d49bf80ab78537eda1ea864d40e6c23d3733d9d5 (plain)
1
2
3
4
5
6
7
8
9
10
#[path = "formats/coco_static_size.rs"]
mod format;

#[unsafe(no_mangle)]
fn bench_read_from_prefix_static_size(source: &[u8]) -> Option<format::LocoPacket> {
    match zerocopy::FromBytes::read_from_prefix(source) {
        Ok((packet, _rest)) => Some(packet),
        _ => None,
    }
}