Introduce a new bincode internal error

This commit is contained in:
Clément Renault 2024-11-20 13:23:11 +01:00
parent fe5d50969a
commit 7cb8732b45
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F
2 changed files with 3 additions and 2 deletions

View File

@ -56,6 +56,8 @@ pub enum InternalError {
#[error(transparent)] #[error(transparent)]
SerdeJson(#[from] serde_json::Error), SerdeJson(#[from] serde_json::Error),
#[error(transparent)] #[error(transparent)]
BincodeError(#[from] bincode::Error),
#[error(transparent)]
Serialization(#[from] SerializationError), Serialization(#[from] SerializationError),
#[error(transparent)] #[error(transparent)]
Store(#[from] MdbError), Store(#[from] MdbError),

View File

@ -48,8 +48,7 @@ where
} }
let mut file = tempfile::tempfile()?; let mut file = tempfile::tempfile()?;
/// manage error bincode::serialize_into(&mut file, &rtree).map_err(InternalError::BincodeError)?;
bincode::serialize_into(&mut file, &rtree).unwrap();
file.sync_all()?; file.sync_all()?;
let rtree_mmap = unsafe { Mmap::map(&file)? }; let rtree_mmap = unsafe { Mmap::map(&file)? };