summaryrefslogtreecommitdiff
path: root/rust/zerocopy/benches/try_ref_from_bytes_dynamic_padding.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/zerocopy/benches/try_ref_from_bytes_dynamic_padding.rs')
-rw-r--r--rust/zerocopy/benches/try_ref_from_bytes_dynamic_padding.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/rust/zerocopy/benches/try_ref_from_bytes_dynamic_padding.rs b/rust/zerocopy/benches/try_ref_from_bytes_dynamic_padding.rs
new file mode 100644
index 000000000..126009cd7
--- /dev/null
+++ b/rust/zerocopy/benches/try_ref_from_bytes_dynamic_padding.rs
@@ -0,0 +1,7 @@
+#[path = "formats/coco_dynamic_padding.rs"]
+mod format;
+
+#[unsafe(no_mangle)]
+fn bench_try_ref_from_bytes_dynamic_padding(source: &[u8]) -> Option<&format::CocoPacket> {
+ zerocopy::TryFromBytes::try_ref_from_bytes(source).ok()
+}