Skip to content

Commit

Permalink
One last lint
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Mar 30, 2024
1 parent 5930a5b commit cf40586
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
8 changes: 3 additions & 5 deletions xmtp_mls/src/groups/members.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ pub fn aggregate_member_list(openmls_group: &OpenMlsGroup) -> Result<Vec<GroupMe
let member_map: HashMap<String, GroupMember> = openmls_group
.members()
.filter_map(|member| {
let basic_credential = BasicCredential::try_from(
&member.credential
)
.ok()
.map(|basic_credential| (basic_credential))?;
let basic_credential = BasicCredential::try_from(&member.credential)
.ok()
.map(|basic_credential| (basic_credential))?;

Check warning on line 43 in xmtp_mls/src/groups/members.rs

View workflow job for this annotation

GitHub Actions / workspace

unnecessary map of the identity function

warning: unnecessary map of the identity function --> xmtp_mls/src/groups/members.rs:42:22 | 42 | .ok() | ______________________^ 43 | | .map(|basic_credential| (basic_credential))?; | |___________________________________________________________^ help: remove the call to `map` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity = note: `#[warn(clippy::map_identity)]` on by default
Identity::get_validated_account_address(
basic_credential.identity(),
&member.signature_key,
Expand Down
2 changes: 1 addition & 1 deletion xmtp_mls/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ where

let mut mls_group = mls_welcome.into_group(provider)?;
mls_group.save(provider.key_store())?;

let group_id = mls_group.group_id().to_vec();
let to_store = StoredGroup::new(group_id, now_ns(), GroupMembershipState::Pending);
let stored_group = provider.conn().insert_or_ignore_group(to_store)?;
Expand Down
5 changes: 2 additions & 3 deletions xmtp_mls/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ use openmls::{
extensions::{errors::InvalidExtensionError, ApplicationIdExtension, LastResortExtension},
prelude::{
tls_codec::{Error as TlsCodecError, Serialize},
Capabilities, Credential as OpenMlsCredential, CredentialType, CredentialWithKey,
CryptoConfig, Extension, ExtensionType, Extensions, KeyPackage, KeyPackageNewError,
Lifetime,
Capabilities, Credential as OpenMlsCredential, CredentialWithKey, CryptoConfig, Extension,
ExtensionType, Extensions, KeyPackage, KeyPackageNewError, Lifetime,
},
versions::ProtocolVersion,
};
Expand Down

0 comments on commit cf40586

Please sign in to comment.