Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Dec 12, 2024
1 parent 10464d3 commit a196897
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 4 additions & 4 deletions xmtp_mls/src/groups/device_sync/preference_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ mod tests {

amal_a.sync_welcomes(&amal_a_provider).await.unwrap();

let sync_group_a = amal_a.get_sync_group(&amal_a_conn).unwrap();
let sync_group_b = amal_b.get_sync_group(&amal_b_conn).unwrap();
let sync_group_a = amal_a.get_sync_group(amal_a_conn).unwrap();
let sync_group_b = amal_b.get_sync_group(amal_b_conn).unwrap();
assert_eq!(sync_group_a.group_id, sync_group_b.group_id);

sync_group_a.sync_with_conn(&amal_a_provider).await.unwrap();
Expand All @@ -152,8 +152,8 @@ mod tests {
// Wait for a to process the new hmac key
amal_a_worker.wait_for_processed_count(2).await.unwrap();

let pref_a = StoredUserPreferences::load(&amal_a_conn).unwrap();
let pref_b = StoredUserPreferences::load(&amal_b_conn).unwrap();
let pref_a = StoredUserPreferences::load(amal_a_conn).unwrap();
let pref_b = StoredUserPreferences::load(amal_b_conn).unwrap();

assert_eq!(pref_a.hmac_key, pref_b.hmac_key);
}
Expand Down
7 changes: 1 addition & 6 deletions xmtp_mls/src/storage/encrypted_store/user_preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@ impl StoredUserPreferences {
let query = dsl::user_preferences.order(dsl::id.desc()).limit(1);
let mut result = conn.raw_query(|conn| query.load::<StoredUserPreferences>(conn))?;

let result = match result.pop() {
Some(result) => result,
None => Self::default(),
};

Ok(result)
Ok(result.pop().unwrap_or_default())
}

pub fn new_hmac_key<C>(
Expand Down

0 comments on commit a196897

Please sign in to comment.