Skip to content

Commit

Permalink
fix: mostly clippy annotation warnings (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuddman authored Feb 23, 2024
1 parent 6a77b91 commit e3eb9f7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/cli/json_logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn get_level(level: log::Level) -> u8 {
}
}

fn format_kv_pairs<'b>(out: &mut StdoutLock<'b>, record: &Record) {
fn format_kv_pairs(out: &mut StdoutLock<'_>, record: &Record) {
struct Visitor<'a, 'b> {
string: &'a mut StdoutLock<'b>,
}
Expand All @@ -73,7 +73,7 @@ fn format_kv_pairs<'b>(out: &mut StdoutLock<'b>, record: &Record) {
record.key_values().visit(&mut visitor).unwrap();
}

pub fn make_value<'v, ValueType>(value: &'v ValueType) -> log::kv::Value<'v>
pub fn make_value<ValueType>(value: &ValueType) -> log::kv::Value<'_>
where
ValueType: serde::Serialize,
{
Expand Down
4 changes: 2 additions & 2 deletions xmtp_mls/src/credential/validated_legacy_signed_public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ impl TryFrom<LegacySignedPublicKeyProto> for ValidatedLegacySignedPublicKey {

Ok(Self {
account_address,
wallet_signature: wallet_signature,
serialized_key_data: serialized_key_data,
wallet_signature,
serialized_key_data,
public_key_bytes,
created_ns,
})
Expand Down
1 change: 1 addition & 0 deletions xmtp_mls/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ where
}

// Create a new group and save it to the DB
#[allow(clippy::unwrap_or_default)]
pub fn create_and_insert(
client: &'c Client<ApiClient>,
membership_state: GroupMembershipState,
Expand Down
2 changes: 1 addition & 1 deletion xmtp_mls/src/storage/encrypted_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl EncryptedMessageStore {
}

#[allow(dead_code)]
fn warn_length<T>(list: &Vec<T>, str_id: &str, max_length: usize) {
fn warn_length<T>(list: &[T], str_id: &str, max_length: usize) {
if list.len() > max_length {
warn!(
"EncryptedStore expected at most {} {} however found {}. Using the Oldest.",
Expand Down

0 comments on commit e3eb9f7

Please sign in to comment.