From 882984dd41fb864f6a44ed46d6f3ede739c56bd3 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Thu, 8 Feb 2024 19:43:31 -0500 Subject: [PATCH] And i think the last one --- lib/oxigraph/src/storage/backend/rocksdb.rs | 10 ++-------- lib/oxrdfio/src/error.rs | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/oxigraph/src/storage/backend/rocksdb.rs b/lib/oxigraph/src/storage/backend/rocksdb.rs index fed85421..184e30fe 100644 --- a/lib/oxigraph/src/storage/backend/rocksdb.rs +++ b/lib/oxigraph/src/storage/backend/rocksdb.rs @@ -1314,6 +1314,8 @@ impl SstFileWriter { } } +#[derive(thiserror::Error)] +#[error("{}", self.message())] struct ErrorStatus(rocksdb_status_t); unsafe impl Send for ErrorStatus {} @@ -1352,14 +1354,6 @@ impl fmt::Debug for ErrorStatus { } } -impl fmt::Display for ErrorStatus { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.message()) - } -} - -impl Error for ErrorStatus {} - impl From for StorageError { fn from(status: ErrorStatus) -> Self { if status.0.code == rocksdb_status_code_t_rocksdb_status_code_io_error { diff --git a/lib/oxrdfio/src/error.rs b/lib/oxrdfio/src/error.rs index ea8fe312..4968e966 100644 --- a/lib/oxrdfio/src/error.rs +++ b/lib/oxrdfio/src/error.rs @@ -63,7 +63,7 @@ impl SyntaxError { /// The location of the error inside of the file. #[inline] pub fn location(&self) -> Option> { - match &self { + match self { Self::Turtle(e) => { let location = e.location(); Some(