maraiah: make check_data use a template
parent
14d9850653
commit
628494e8a4
|
@ -235,7 +235,8 @@ macro_rules! read_data {
|
|||
/// # Errors
|
||||
///
|
||||
/// Returns `Err` if `b.len()` is less than `sz`.
|
||||
pub fn check_data(b: &[u8], sz: usize) -> ResultS<()>
|
||||
#[inline]
|
||||
pub fn check_data<T>(b: &[T], sz: usize) -> ResultS<()>
|
||||
{
|
||||
if b.len() < sz {
|
||||
Err(err_msg("not enough data"))
|
||||
|
|
Loading…
Reference in New Issue