2 const CURSOR_PARTITION_LABEL: &'static [u8] = b"partition";
3 const CURSOR_EVENT_TYPE_LABEL: &'static [u8] = b"event_type";
4 const BYTE_PATTERN: &'static [u8; 5] = b"hello";
6 fn match_slice(x: &[u8]) -> u32 {
8 CURSOR_PARTITION_LABEL => 0,
9 CURSOR_EVENT_TYPE_LABEL => 1,
14 fn match_array(x: &[u8; 5]) -> bool {
22 assert_eq!(match_slice(b"abcde"), 2);
23 assert_eq!(match_slice(b"event_type"), 1);
24 assert_eq!(match_slice(b"partition"), 0);
26 assert_eq!(match_array(b"hello"), true);
27 assert_eq!(match_array(b"hella"), false);