Apply suggestions from code review

Co-authored-by: Jonas Platte <jplatte@element.io>
This commit is contained in:
Benjamin Kampmann
2022-04-19 16:19:30 +02:00
committed by GitHub
parent e989b9aff7
commit cdab735ce5
2 changed files with 4 additions and 4 deletions

View File

@@ -277,8 +277,8 @@ macro_rules! statestore_integration_tests {
assert!(store.get_sync_token().await?.is_some());
assert!(store.get_presence_event(user_id).await?.is_some());
assert_eq!(store.get_room_infos().await?.len(), 1, "Expected to find 1 room info ");
assert_eq!(store.get_stripped_room_infos().await?.len(), 1, "Expected to find 1 stripped room info");
assert_eq!(store.get_room_infos().await?.len(), 1, "Expected to find 1 room info ");
assert_eq!(store.get_stripped_room_infos().await?.len(), 1, "Expected to find 1 stripped room info");
assert!(store.get_account_data_event(GlobalAccountDataEventType::PushRules).await?.is_some());
assert!(store.get_state_event(room_id, StateEventType::RoomName, "").await?.is_some());

View File

@@ -303,7 +303,7 @@ impl StoreCipher {
///
/// # Examples
///
/// ```
/// ```no_run
/// # let example = || {
/// use matrix_sdk_store_encryption::StoreCipher;
/// use serde_json::{json, value::Value};
@@ -318,7 +318,7 @@ impl StoreCipher {
/// let decrypted: Value = store_cipher.decrypt_value_typed(&encrypted)?;
///
/// assert_eq!(value, decrypted);
/// # Result::<_, anyhow::Error>::Ok(()) };
/// # anyhow::Ok(()) };
/// ```
pub fn encrypt_value_typed(&self, value: &impl Serialize) -> Result<EncryptedValue, Error> {
let data = serde_json::to_vec(value)?;