Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Dec 19, 2024
1 parent e7f933b commit 4c72ddc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bindings_node/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl From<ListMessagesOptions> for MsgQueryArgs {
MsgQueryArgs {
sent_before_ns: opts.sent_before_ns,
sent_after_ns: opts.sent_after_ns,
delivery_status: delivery_status,
delivery_status,
limit: opts.limit,
direction,
..Default::default()
Expand Down
8 changes: 5 additions & 3 deletions xmtp_mls/src/groups/group_metadata.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::fmt::Display;

use openmls::{extensions::Extensions, group::MlsGroup as OpenMlsGroup};
use prost::Message;
use thiserror::Error;
Expand Down Expand Up @@ -188,12 +190,12 @@ where
}
}

impl<Id> ToString for DmMembers<Id>
impl<Id> Display for DmMembers<Id>
where
Id: AsRef<str>,
{
fn to_string(&self) -> String {
String::from(self)
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", String::from(self))
}
}

Expand Down
10 changes: 3 additions & 7 deletions xmtp_mls/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ impl<ScopedClient: ScopedGroupClient> MlsGroup<ScopedClient> {
&dm_id[..inbox_id.len()]
};

return Ok(target_inbox.to_string());
Ok(target_inbox.to_string())
}

/// Find the `consent_state` of the group
Expand Down Expand Up @@ -1674,16 +1674,13 @@ pub(crate) mod tests {
use diesel::{ExpressionMethods, RunQueryDsl};
use futures::future::join_all;
use prost::Message;
use std::{sync::Arc, time::Duration};
use std::sync::Arc;
use wasm_bindgen_test::wasm_bindgen_test;
use xmtp_common::assert_err;
use xmtp_content_types::{group_updated::GroupUpdatedCodec, ContentCodec};
use xmtp_cryptography::utils::generate_local_wallet;
use xmtp_proto::xmtp::mls::message_contents::plaintext_envelope::Content;
use xmtp_proto::xmtp::mls::api::v1::group_message::Version;
use xmtp_proto::xmtp::mls::message_contents::EncodedContent;
use xmtp_proto::xmtp::mls::{
api::v1::group_message::Version, message_contents::PlaintextEnvelope,
};

use crate::storage::group::StoredGroup;
use crate::storage::schema::{group_messages, groups};
Expand Down Expand Up @@ -2071,7 +2068,6 @@ pub(crate) mod tests {
.unwrap();

bo_dm.send_message(b"Hello there").await.unwrap();
std::thread::sleep(Duration::from_millis(20));
alix_dm
.send_message(b"No, let's use this dm")
.await
Expand Down
7 changes: 2 additions & 5 deletions xmtp_mls/src/storage/encrypted_store/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ impl DmIdExt for String {
&dm_id[..id.len()]
};

return target_inbox.to_string();
target_inbox.to_string()
}
}

Expand All @@ -586,10 +586,7 @@ pub(crate) mod tests {
#[cfg(target_arch = "wasm32")]
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_dedicated_worker);

use std::{
sync::atomic::{AtomicU16, Ordering},
time::Duration,
};
use std::sync::atomic::{AtomicU16, Ordering};

use super::*;
use crate::{
Expand Down

0 comments on commit 4c72ddc

Please sign in to comment.