maraiah: make check_data use a template

master
an 2019-07-01 01:22:18 -04:00
parent 14d9850653
commit 628494e8a4
1 changed files with 2 additions and 1 deletions

View File

@ -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"))