Do not leak an internal grenad Error

This commit is contained in:
Kerollmops 2022-06-16 12:03:43 +02:00
parent 8ebf5eed0d
commit dc3f092d07
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
3 changed files with 38 additions and 3 deletions

View file

@ -7,6 +7,7 @@ use rayon::ThreadPoolBuildError;
use serde_json::Value;
use thiserror::Error;
use crate::documents::DocumentsBatchCursorError;
use crate::{CriterionError, DocumentId, FieldId, Object, SortError};
pub fn is_reserved_keyword(keyword: &str) -> bool {
@ -209,6 +210,12 @@ where
}
}
impl From<DocumentsBatchCursorError> for Error {
fn from(error: DocumentsBatchCursorError) -> Error {
Error::from(Into::<grenad::Error>::into(error))
}
}
impl From<Infallible> for Error {
fn from(_error: Infallible) -> Error {
unreachable!()