diff --git a/minisql/src/error.rs b/minisql/src/error.rs index 0574aff..2552f74 100644 --- a/minisql/src/error.rs +++ b/minisql/src/error.rs @@ -36,9 +36,9 @@ pub enum TypeConversionError { NumberDecodeFailed(#[from] ParseFloatError), #[error("failed to parse int from text")] IntDecodeFailed(#[from] ParseIntError), - #[error("uknown type with oid {oid} and size {size}")] + #[error("unknown type with oid {oid} and size {size}")] UnknownType { oid: i32, - size: i32 + size: i16 } } diff --git a/minisql/src/type_system.rs b/minisql/src/type_system.rs index caa85ab..03cfb13 100644 --- a/minisql/src/type_system.rs +++ b/minisql/src/type_system.rs @@ -53,7 +53,7 @@ impl Value { } } - pub fn type_size(&self) -> i32 { + pub fn type_size(&self) -> i16 { match self { Self::Number(_) => 8, Self::Indexable(val) => match val { @@ -75,7 +75,7 @@ impl Value { } } - pub fn from_text_bytes(bytes: &[u8], type_oid: i32, type_size: i32) -> Result { + pub fn from_text_bytes(bytes: &[u8], type_oid: i32, type_size: i16) -> Result { match (type_oid, type_size) { (701, 8) => { let s = std::str::from_utf8(bytes)?;