From a90d74ac81753167c78e4fd7342b502630273986 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 20 Jun 2024 17:19:48 +0200 Subject: [PATCH] Rename StatusError::Io to StatusError::Sqlite The previous name was misleading. --- vstorage/src/sync/status.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vstorage/src/sync/status.rs b/vstorage/src/sync/status.rs index 718ff77..7aaa05e 100644 --- a/vstorage/src/sync/status.rs +++ b/vstorage/src/sync/status.rs @@ -11,8 +11,8 @@ const SCHEMA_VERSION: i64 = 2; /// Error interacting with status database. #[derive(thiserror::Error, Debug)] pub enum StatusError { - #[error("IO error operating with status database: {0}")] - Io(#[from] sqlite::Error), + #[error("Error interacting with sqlite backend: {0}")] + Sqlite(#[from] sqlite::Error), #[error("UPDATE did no affect any rows")] NoUpdate, #[error("Could not create parent directories")] @@ -108,13 +108,13 @@ impl StatusDatabase { /// /// # Errors /// - /// Returns [`StatusError::Io`] if sqlite fails to open the database. + /// Returns [`StatusError::Sqlite`] if sqlite fails to open the database. pub fn open_readonly(path: impl AsRef) -> Result, StatusError> { let flags = OpenFlags::new().with_read_only().with_full_mutex(); match Connection::open_thread_safe_with_flags(path, flags) { Ok(conn) => Ok(Some(StatusDatabase { conn })), Err(e) if e.code == Some(14) => Ok(None), - Err(e) => Err(StatusError::Io(e)), + Err(e) => Err(StatusError::Sqlite(e)), } } @@ -122,7 +122,7 @@ impl StatusDatabase { /// /// # Errors /// - /// Returns [`StatusError::Io`] if sqlite fails to open or create the database. + /// Returns [`StatusError::Sqlite`] if sqlite fails to open or create the database. pub fn open_or_create(path: impl AsRef) -> Result { let path = path.as_ref(); if let Some(parent) = path.parent() { -- 2.45.2