diff --git a/bindings/matrix-sdk-ffi/src/sliding_sync.rs b/bindings/matrix-sdk-ffi/src/sliding_sync.rs index ded3cd4f6..cfe0a22cf 100644 --- a/bindings/matrix-sdk-ffi/src/sliding_sync.rs +++ b/bindings/matrix-sdk-ffi/src/sliding_sync.rs @@ -144,7 +144,7 @@ impl From 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 } diff --git a/crates/matrix-sdk/src/sliding_sync/cache.rs b/crates/matrix-sdk/src/sliding_sync/cache.rs index c14687a12..848d360f0 100644 --- a/crates/matrix-sdk/src/sliding_sync/cache.rs +++ b/crates/matrix-sdk/src/sliding_sync/cache.rs @@ -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?; diff --git a/crates/matrix-sdk/src/sliding_sync/list/mod.rs b/crates/matrix-sdk/src/sliding_sync/list/mod.rs index 66b4989fd..959e06299 100644 --- a/crates/matrix-sdk/src/sliding_sync/list/mod.rs +++ b/crates/matrix-sdk/src/sliding_sync/list/mod.rs @@ -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),