remove unwraps

This commit is contained in:
Nicholas Orlowsky 2023-08-08 16:07:51 -05:00 committed by Nicholas Orlowsky
parent 7f85e2debf
commit 3d9c53237c
3 changed files with 38 additions and 28 deletions

View file

@ -51,8 +51,11 @@ impl Datatype {
Ok(str_val)
}
Datatype::Integer => {
let val = data_val.first().unwrap();
Ok(format!("{}", val))
if let Some(val) = data_val.first() {
Ok(format!("{}", val))
} else {
Err(anyhow!("Unable to parse Integer"))
}
}
}
}