From 2acd2e9876bb6450db0f3b3713b975311c0f5322 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 13 Mar 2022 03:29:00 +0100 Subject: insert(): Remove `unwrap()`s Use a new `yaqlite::Error` type. Remove the other error types and use this main error type everywhere. For now, that seems simpler. The real reason why I centralised on one error type is that I wanted a single `Error::Sqlite` variant for both `rusqlite::Error` and `SqliteError` errors. However, I wasn't sure if it's possible to do that with `thiserror`, and I didn't want to bother having to write my own `std::error::Error` impls. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 0ac5a26..0ec2724 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ fn main() { let mut yaml_data = yaml::YamlLoader::load_from_str(&text_data).unwrap(); - yaqlite::insert(&mut dbconn, "people", &mut yaml_data); + yaqlite::insert(&mut dbconn, "people", &mut yaml_data).unwrap(); dbg!(yaml_data); -- cgit v1.2.3