Function parser_compose::first_slice_item
source · pub fn first_slice_item<T>(input: &[T]) -> Option<(&[T], &[T])>
Expand description
A parser that recognizes the first item in a slice.
use parser_compose::{Parser, first_slice_item};
let msg = &[254, 1, 2][..];
let (value, _) = first_slice_item(msg).unwrap();
assert_eq!(*value, [254]);