vmm: fix cargo clippy error for rust 1.77

Since cloning Option<Arc<T>> will clone for Arc<T>, this patch fixes the
follow warning:

warning: this call to `as_ref.map(...)` does nothing
   --> vmm/src/lib.rs:872:13
    |
872 |             self.console_resize_pipe.as_ref().map(Arc::clone),
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.console_resize_pipe.clone()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
    = note: `#[warn(clippy::useless_asref)]` on by default

Signed-off-by: Songqian Li <sionli@tencent.com>
This commit is contained in:
Songqian Li 2024-09-30 11:37:30 +08:00 committed by Rob Bradford
parent 33c15ca273
commit ab12e7c294

View File

@ -869,7 +869,7 @@ impl Vmm {
activate_evt,
timestamp,
self.console_info.clone(),
self.console_resize_pipe.as_ref().map(Arc::clone),
self.console_resize_pipe.clone(),
Arc::clone(&self.original_termios_opt),
Some(snapshot),
)
@ -1307,7 +1307,7 @@ impl RequestHandler for Vmm {
self.hypervisor.clone(),
activate_evt,
self.console_info.clone(),
self.console_resize_pipe.as_ref().map(Arc::clone),
self.console_resize_pipe.clone(),
Arc::clone(&self.original_termios_opt),
None,
None,
@ -1434,7 +1434,7 @@ impl RequestHandler for Vmm {
self.hypervisor.clone(),
activate_evt,
self.console_info.clone(),
self.console_resize_pipe.as_ref().map(Arc::clone),
self.console_resize_pipe.clone(),
Arc::clone(&self.original_termios_opt),
Some(snapshot),
Some(source_url),
@ -1536,7 +1536,7 @@ impl RequestHandler for Vmm {
self.hypervisor.clone(),
activate_evt,
self.console_info.clone(),
self.console_resize_pipe.as_ref().map(Arc::clone),
self.console_resize_pipe.clone(),
Arc::clone(&self.original_termios_opt),
None,
None,