Get ride of rust messagepack (rmp)

This commit is contained in:
Clément Renault 2019-10-11 16:16:21 +02:00
parent 81bf6d583d
commit 710ab2386c
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
9 changed files with 45 additions and 76 deletions

View file

@ -104,7 +104,7 @@ impl Index {
{
let bytes = self.documents_fields.document_attribute(reader, document_id, attribute)?;
match bytes {
Some(bytes) => Ok(Some(rmp_serde::from_read_ref(bytes)?)),
Some(bytes) => Ok(Some(serde_json::from_slice(bytes)?)),
None => Ok(None),
}
}

View file

@ -68,7 +68,7 @@ impl Updates {
) -> MResult<()>
{
let update_id_bytes = update_id.to_be_bytes();
let update = rmp_serde::to_vec_named(&update)?;
let update = serde_json::to_vec(&update)?;
let blob = Value::Blob(&update);
self.updates.put(writer, update_id_bytes, &blob)?;
Ok(())
@ -86,8 +86,7 @@ impl Updates {
match first_data {
Some(Value::Blob(bytes)) => {
let update = rmp_serde::from_read_ref(&bytes)?;
let update = serde_json::from_slice(&bytes)?;
// remove it from the database now
let first_id_bytes = first_id.to_be_bytes();
self.updates.delete(writer, first_id_bytes)?;