From 445873540edd1c4b21dc1c5039a489666cac1f30 Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 5 May 2021 12:53:11 +0300 Subject: Made some StorageError fields private and added getters instead --- src/database/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/database/mod.rs b/src/database/mod.rs index f0a1e4b..cdd5c43 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -30,9 +30,9 @@ pub enum ErrorKind { #[derive(Debug)] pub struct StorageError { - pub msg: String, + msg: String, source: Option>, - pub kind: ErrorKind + kind: ErrorKind } unsafe impl Send for StorageError {} unsafe impl Sync for StorageError {} @@ -99,6 +99,9 @@ impl StorageError { pub fn kind(&self) -> ErrorKind { self.kind } + pub fn msg(&self) -> &str { + &self.msg + } } -- cgit 1.4.1