fix clippy

This commit is contained in:
Maybe Waffle 2022-11-07 21:17:01 +04:00
parent 405cf34f03
commit d9bd9e131f

View file

@ -72,11 +72,11 @@ where
Box::pin(async move { Box::pin(async move {
let key = chat_id.to_le_bytes(); let key = chat_id.to_le_bytes();
if self.db.get(&key)?.is_none() { if self.db.get(key)?.is_none() {
return Err(RocksDbStorageError::DialogueNotFound); return Err(RocksDbStorageError::DialogueNotFound);
} }
self.db.delete(&key).unwrap(); self.db.delete(key).unwrap();
Ok(()) Ok(())
}) })
@ -92,7 +92,7 @@ where
self.serializer.serialize(&dialogue).map_err(RocksDbStorageError::SerdeError)?; self.serializer.serialize(&dialogue).map_err(RocksDbStorageError::SerdeError)?;
let key = chat_id.to_le_bytes(); let key = chat_id.to_le_bytes();
self.db.put(&key, &d)?; self.db.put(key, &d)?;
Ok(()) Ok(())
}) })
@ -105,7 +105,7 @@ where
Box::pin(async move { Box::pin(async move {
let key = chat_id.to_le_bytes(); let key = chat_id.to_le_bytes();
self.db self.db
.get(&key)? .get(key)?
.map(|d| self.serializer.deserialize(&d).map_err(RocksDbStorageError::SerdeError)) .map(|d| self.serializer.deserialize(&d).map_err(RocksDbStorageError::SerdeError))
.transpose() .transpose()
}) })