enable assigning_clones lint

This commit is contained in:
Charles Hall 2024-05-21 22:03:31 -07:00
parent 793d809ac6
commit c9859a9b2d
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
6 changed files with 14 additions and 14 deletions

View file

@ -72,7 +72,6 @@ wildcard_dependencies = "warn"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
assigning_clones = "allow"
doc_markdown = "allow"
manual_is_variant_and = "allow"
mixed_attributes_style = "allow"

View file

@ -60,7 +60,7 @@ pub(crate) async fn update_device_route(
.get_device_metadata(sender_user, &body.device_id)?
.ok_or(Error::BadRequest(ErrorKind::NotFound, "Device not found."))?;
device.display_name = body.display_name.clone();
device.display_name.clone_from(&body.display_name);
services().users.update_device_metadata(
sender_user,

View file

@ -221,7 +221,7 @@ pub(crate) async fn kick_user_route(
.map_err(|_| Error::bad_database("Invalid member event in database."))?;
event.membership = MembershipState::Leave;
event.reason = body.reason.clone();
event.reason.clone_from(&body.reason);
let mutex_state = Arc::clone(
services()
@ -360,7 +360,7 @@ pub(crate) async fn unban_user_route(
.map_err(|_| Error::bad_database("Invalid member event in database."))?;
event.membership = MembershipState::Leave;
event.reason = body.reason.clone();
event.reason.clone_from(&body.reason);
let mutex_state = Arc::clone(
services()

View file

@ -997,8 +997,8 @@ impl KeyValueDatabase {
.get(content_rule_transformation[0]);
if rule.is_some() {
let mut rule = rule.unwrap().clone();
rule.rule_id =
content_rule_transformation[1].to_owned();
content_rule_transformation[1]
.clone_into(&mut rule.rule_id);
rules_list
.content
.shift_remove(content_rule_transformation[0]);
@ -1027,7 +1027,7 @@ impl KeyValueDatabase {
rules_list.underride.get(transformation[0]);
if let Some(rule) = rule {
let mut rule = rule.clone();
rule.rule_id = transformation[1].to_owned();
transformation[1].clone_into(&mut rule.rule_id);
rules_list
.underride
.shift_remove(transformation[0]);

View file

@ -256,11 +256,11 @@ impl Service {
pusher.ids.pushkey.clone(),
);
device.data.default_payload = http.default_payload.clone();
device.data.format = http.format.clone();
device.data.format.clone_from(&http.format);
// Tweaks are only added if the format is NOT event_id_only
if !event_id_only {
device.tweaks = tweaks.clone();
device.tweaks.clone_from(&tweaks);
}
let d = vec![device];

View file

@ -87,11 +87,12 @@ impl Service {
for (list_id, list) in &mut request.lists {
if let Some(cached_list) = cached.lists.get(list_id) {
if list.sort.is_empty() {
list.sort = cached_list.sort.clone();
list.sort.clone_from(&cached_list.sort);
};
if list.room_details.required_state.is_empty() {
list.room_details.required_state =
cached_list.room_details.required_state.clone();
list.room_details
.required_state
.clone_from(&cached_list.room_details.required_state);
};
list.room_details.timeline_limit = list
.room_details
@ -140,8 +141,8 @@ impl Service {
(..) => {}
}
if list.bump_event_types.is_empty() {
list.bump_event_types =
cached_list.bump_event_types.clone();
list.bump_event_types
.clone_from(&cached_list.bump_event_types);
};
}
cached.lists.insert(list_id.clone(), list.clone());