Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Jan 17, 2025
1 parent d0dcf16 commit 1672862
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ impl From<BackupMetadata> for FfiBackupMetadata {
fn from(value: BackupMetadata) -> Self {
Self {
backup_version: value.backup_version,
elements: value.elements().into_iter().map(Into::into).collect(),
elements: value.elements().map(Into::into).collect(),
start_ns: value.start_ns,
end_ns: value.end_ns,
exported_at_ns: value.exported_at_ns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl BackupExporter {

let mut amount = self.read(&mut buffer).await?;
while amount != 0 {
file.write(&buffer[..amount]).await?;
let _ = file.write(&buffer[..amount]).await?;
amount = self.read(&mut buffer).await?;
}

Expand Down
4 changes: 2 additions & 2 deletions xmtp_mls/src/groups/device_sync/backup/backup_importer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl BackupImporter {
));
}

if amount == 0 && self.decoded.len() == 0 {
if amount == 0 && self.decoded.is_empty() {
break;
}
}
Expand All @@ -101,7 +101,7 @@ impl BackupImporter {
Ok(())
})
.await
.map_err(|e| DeviceSyncError::Storage(e))?;
.map_err(DeviceSyncError::Storage)?;
Ok(())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ impl BackupRecordProvider for GroupSave {
let mut query = groups::table.order_by(groups::id).into_boxed();

if let Some(start_ns) = streamer.start_ns {
query = query.filter(groups::created_at_ns.gt(start_ns as i64));
query = query.filter(groups::created_at_ns.gt(start_ns));
}
if let Some(end_ns) = streamer.end_ns {
query = query.filter(groups::created_at_ns.le(end_ns as i64));
query = query.filter(groups::created_at_ns.le(end_ns));
}

query = query.limit(Self::BATCH_SIZE).offset(streamer.offset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ impl BackupRecordProvider for GroupMessageSave {
.into_boxed();

if let Some(start_ns) = streamer.start_ns {
query = query.filter(group_messages::sent_at_ns.gt(start_ns as i64));
query = query.filter(group_messages::sent_at_ns.gt(start_ns));
}
if let Some(end_ns) = streamer.end_ns {
query = query.filter(group_messages::sent_at_ns.le(end_ns as i64));
query = query.filter(group_messages::sent_at_ns.le(end_ns));
}

query = query.limit(Self::BATCH_SIZE).offset(streamer.offset);
Expand Down

0 comments on commit 1672862

Please sign in to comment.