enable implicit_clone lint

This commit is contained in:
Charles Hall 2024-05-14 17:08:36 -07:00
parent b0f65913f3
commit ebae8ceeb0
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
17 changed files with 24 additions and 23 deletions

View file

@ -230,7 +230,7 @@ impl Service {
.roomid_mutex_state
.write()
.await
.entry(grapevine_room.to_owned())
.entry(grapevine_room.clone())
.or_default(),
);
@ -1273,7 +1273,7 @@ impl Service {
// Set power level
let mut users = BTreeMap::new();
users.insert(grapevine_user.to_owned(), 100.into());
users.insert(grapevine_user.clone(), 100.into());
users.insert(user_id.to_owned(), 100.into());
services()

View file

@ -128,7 +128,7 @@ impl Service {
Ok(Some(FileMeta {
content_disposition,
content_type,
file: file.to_vec(),
file: file.clone(),
}))
} else if let Ok((content_disposition, content_type, key)) =
self.db.search_file_metadata(mxc.clone(), 0, 0)
@ -145,7 +145,7 @@ impl Service {
return Ok(Some(FileMeta {
content_disposition,
content_type,
file: file.to_vec(),
file: file.clone(),
}));
}
@ -211,14 +211,14 @@ impl Service {
Ok(Some(FileMeta {
content_disposition,
content_type,
file: thumbnail_bytes.to_vec(),
file: thumbnail_bytes.clone(),
}))
} else {
// Couldn't parse file to generate thumbnail, send original
Ok(Some(FileMeta {
content_disposition,
content_type,
file: file.to_vec(),
file: file.clone(),
}))
}
} else {

View file

@ -99,7 +99,7 @@ impl Service {
// 1. Skip the PDU if we already have it as a timeline event
if let Some(pdu_id) = services().rooms.timeline.get_pdu_id(event_id)? {
return Ok(Some(pdu_id.to_vec()));
return Ok(Some(pdu_id.clone()));
}
let create_event = services()

View file

@ -81,7 +81,7 @@ impl Service {
.roomid_spacechunk_cache
.lock()
.await
.get_mut(&current_room.to_owned())
.get_mut(&current_room.clone())
.as_ref()
{
if let Some(cached) = cached {
@ -202,7 +202,7 @@ impl Service {
.send_federation_request(
server,
federation::space::get_hierarchy::v1::Request {
room_id: current_room.to_owned(),
room_id: current_room.clone(),
suggested_only,
},
)

View file

@ -1180,7 +1180,7 @@ impl Service {
.roomid_mutex_federation
.write()
.await
.entry(room_id.to_owned())
.entry(room_id.clone())
.or_default(),
);
let mutex_lock = mutex.lock().await;

View file

@ -409,7 +409,7 @@ impl Service {
)?;
for ((outgoing_kind, event), key) in requests.into_iter().zip(keys) {
self.sender
.send((outgoing_kind.to_owned(), event, key))
.send((outgoing_kind.clone(), event, key))
.unwrap();
}