Fix clippy::assigning_clones lints

Use the potentially more efficient clone_from() function when cloning
and assigning.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I0601b59a80fdebbc09b212110c6e68e23a52bcfe
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604659
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2024-05-16 17:40:01 -07:00 committed by crosvm LUCI
parent 349eb22eb8
commit 4c2fa9d76d
3 changed files with 3 additions and 3 deletions

View file

@ -161,7 +161,7 @@ fn do_overlay_filter(filtered_paths: Vec<Path>, overlay: &mut Fdt) {
tgt_node = tgt_node
.subnode_mut(node_name)
.expect("filtered paths reference valid nodes");
tgt_node.props = src_node.props.clone();
tgt_node.props.clone_from(&src_node.props);
}
}
overlay.root = new_root;

View file

@ -451,7 +451,7 @@ impl StreamInfo {
self.buffer_bytes = state.buffer_bytes;
self.period_bytes = state.period_bytes;
self.direction = state.direction;
self.effects = state.effects.clone();
self.effects.clone_from(&state.effects);
self.just_reset = state.just_reset;
}
}

View file

@ -763,7 +763,7 @@ fn crosvm_main<I: IntoIterator<Item = String>>(args: I) -> Result<CommandStatus>
`crosvm --syslog-tag=\"{}\" run` instead",
syslog_tag
);
log_config.log_args.proc_name = syslog_tag.clone();
log_config.log_args.proc_name.clone_from(syslog_tag);
}
// We handle run_vm separately because it does not simply signal success/error
// but also indicates whether the guest requested reset or stop.