Fix clippy lints

This commit is contained in:
Jonas Platte
2023-04-06 09:29:41 +02:00
committed by Jonas Platte
parent 9c54de1817
commit b033508e9b
3 changed files with 10 additions and 10 deletions

View File

@@ -144,7 +144,7 @@ impl From<matrix_sdk::sliding_sync::Error> for SlidingSyncError {
match value {
E::BadResponse(message) => Self::BadResponse { message },
E::BuildMissingField(message) => {
Self::BuildMissingField { message: message.to_string() }
Self::BuildMissingField { message: message.to_owned() }
}
E::RequestGeneratorHasNotBeenInitialized(message) => {
Self::RequestGeneratorHasNotBeenInitialized { message }

View File

@@ -244,7 +244,7 @@ mod tests {
let sliding_sync = client
.sliding_sync()
.await
.storage_key(Some("hello".to_string()))
.storage_key(Some("hello".to_owned()))
.add_list(SlidingSyncList::builder().name("list_foo").build()?)
.build()
.await?;
@@ -278,7 +278,7 @@ mod tests {
let sliding_sync = client
.sliding_sync()
.await
.storage_key(Some("hello".to_string()))
.storage_key(Some("hello".to_owned()))
.add_list(SlidingSyncList::builder().name("list_foo").build()?)
.build()
.await?;

View File

@@ -538,7 +538,7 @@ fn apply_sync_operations(
.range
.ok_or_else(|| {
Error::BadResponse(
"`range` must be present for `SYNC` operation".to_string(),
"`range` must be present for `SYNC` operation".to_owned(),
)
})
.map(|(start, end)| {
@@ -578,7 +578,7 @@ fn apply_sync_operations(
// `room_ids` is absent.
if operation.room_ids.is_empty() {
return Err(Error::BadResponse(
"`room_ids` must be present for `SYNC` operation".to_string(),
"`room_ids` must be present for `SYNC` operation".to_owned(),
));
}
@@ -627,7 +627,7 @@ fn apply_sync_operations(
.index
.ok_or_else(|| {
Error::BadResponse(
"`index` must be present for `DELETE` operation".to_string(),
"`index` must be present for `DELETE` operation".to_owned(),
)
})?
.try_into()
@@ -656,14 +656,14 @@ fn apply_sync_operations(
.index
.ok_or_else(|| {
Error::BadResponse(
"`index` must be present for `INSERT` operation".to_string(),
"`index` must be present for `INSERT` operation".to_owned(),
)
})?
.try_into()
.unwrap();
let room_id = operation.room_id.clone().ok_or_else(|| {
Error::BadResponse(
"`room_id` must be present for `INSERT` operation".to_string(),
"`room_id` must be present for `INSERT` operation".to_owned(),
)
})?;
@@ -692,7 +692,7 @@ fn apply_sync_operations(
.range
.ok_or_else(|| {
Error::BadResponse(
"`range` must be present for `INVALIDATE` operation".to_string(),
"`range` must be present for `INVALIDATE` operation".to_owned(),
)
})
.map(|(start, end)| {
@@ -877,7 +877,7 @@ mod tests {
let list = SlidingSyncList {
inner: Arc::new(SlidingSyncListInner {
sync_mode: SlidingSyncMode::Growing,
sort: vec!["foo".to_string(), "bar".to_string()],
sort: vec!["foo".to_owned(), "bar".to_owned()],
required_state: vec![(StateEventType::RoomName, "baz".to_owned())],
filters: Some(assign!(v4::SyncRequestListFilters::default(), {
is_dm: Some(true),