cloud-hypervisor/vm-allocator/src
Philipp Schuster 6a86c157af misc: clippy: add needless_pass_by_value (partially)
This helps to uncover expensive and needless clones in the code base.
For example, I prevented extensive clones in the snapshot path where
(nested) BTreeMap's have been cloned over and over again. Further,
the lint helps devs to much better reason about the ownership of
parameters.

All of these changes have been done manually with the necessary
caution. A few structs that are cheap to clone are now `copy` so that
this lint won't trigger for them.

I didn't enable the lint so far as it is a massive rabbit hole and
needs much more fixes. Nevertheless, it is very useful.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
2025-11-25 16:05:46 +00:00
..
address.rs misc: clippy: add if_not_else 2025-11-25 16:05:46 +00:00
gsi.rs misc: clippy: add needless_pass_by_value (partially) 2025-11-25 16:05:46 +00:00
lib.rs vm-allocator: Add an allocator KVM memory slots 2024-11-24 10:45:15 +00:00
memory_slot.rs misc: clippy: add semicolon_if_nothing_returned 2025-11-21 09:32:11 +00:00
page_size.rs build: treewide: fmt for edition 2024 2025-09-10 18:35:38 +00:00
system.rs misc: clippy: add needless_pass_by_value (partially) 2025-11-25 16:05:46 +00:00