From 832b372bebad99757b1bd1315119c339e1755ebb Mon Sep 17 00:00:00 2001 From: Paul Kuruvilla Date: Sun, 24 Oct 2021 17:06:07 +0100 Subject: [PATCH] Syncing with codecrafters-io/languages Created by https://github.com/codecrafters-io/languages --- src/record.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/record.rs b/src/record.rs index 8731907..4eadffb 100644 --- a/src/record.rs +++ b/src/record.rs @@ -18,7 +18,7 @@ pub fn parse_record(stream: &[u8], column_count: usize) -> Result>> // Parse each serial type as column into record and modify the offset let mut record = vec![]; for serial_type in serial_types { - let column = parse_column_value(&stream[offset..], serial_type as u8)?; + let column = parse_column_value(&stream[offset..], serial_type as usize)?; offset += column.len(); record.push(column); } @@ -26,7 +26,7 @@ pub fn parse_record(stream: &[u8], column_count: usize) -> Result>> Ok(record) } -fn parse_column_value(stream: &[u8], serial_type: u8) -> Result> { +fn parse_column_value(stream: &[u8], serial_type: usize) -> Result> { let column_value = match serial_type { // 8 bit twos-complement integer 1 => vec![stream[0]],