fn find_header(buffer: &[u8]) -> usize {
	for i in 0..buffer.len() {
		let possible_prefix = HEADER_PREFIX.len().min(buffer.len() - i);
		if buffer[i..].starts_with(&HEADER_PREFIX[..possible_prefix]) {
			return i;
		}
	}

	buffer.len()
}
/// Find the potential starting position of a header.
///
/// This will return the first possible position of the header prefix.
/// Note that if the buffer ends with a partial header prefix,
/// the start position of the partial header prefix is returned.
Find the potential starting position of a header.
This will return the first possible position of the header prefix.
Note that if the buffer ends with a partial header prefix,
the start position of the partial header prefix is returned.
Find the potential starting position of a header . This will return the first possible position of the header prefix . Note that if the buffer ends with a partial header prefix the start position of the partial header prefix is returned .
fn find_header(buffer: &[u8]) -> usize {
	for i in 0..buffer.len() {
		let possible_prefix = HEADER_PREFIX.len().min(buffer.len() - i);
		if buffer[i..].starts_with(&HEADER_PREFIX[..possible_prefix]) {
			return i;
		}
	}
	buffer.len()
}
fn find_header ( buffer : & [ u8 ] ) -> usize { for i in 0 .. buffer . len ( ) { let possible_prefix = HEADER_PREFIX . len ( ) . min ( buffer . len ( ) - i ) ; if buffer [ i .. ] . starts_with ( & HEADER_PREFIX [ .. possible_prefix ] ) { return i ; } } buffer . len ( ) }
Find the potential starting position of a header.
Find the potential starting position of a header .
buffer
&[u8]
buffer
&[u8]