diff options
author | Vika <vika@fireburn.ru> | 2021-05-05 12:53:11 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2021-05-05 12:53:11 +0300 |
commit | 445873540edd1c4b21dc1c5039a489666cac1f30 (patch) | |
tree | 851645c6a5757f0efe67279d486fd19f981ef77e /src/database/mod.rs | |
parent | e6a7f428b04191cfc79174758804ad9b82391aa3 (diff) | |
download | kittybox-445873540edd1c4b21dc1c5039a489666cac1f30.tar.zst |
Made some StorageError fields private and added getters instead
Diffstat (limited to 'src/database/mod.rs')
-rw-r--r-- | src/database/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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<Box<dyn std::error::Error>>, - 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 + } } |