From 6b8680bc1554d5bea54b8fa8fbab014284ccf35a Mon Sep 17 00:00:00 2001 From: Grzegorz Jaszczyk Date: Fri, 29 Apr 2022 17:39:10 +0000 Subject: [PATCH] vm_control: minor style improvements for powerbtn command Minor style improvement - no functional changes. BUG=None TEST=Make sure that "crosvm powerbtn /run/<>/crosvm.sock" works as expected. Change-Id: Ide843707d69c25c9e0473bc8e55db8c4a6da7553 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3616883 Reviewed-by: Daniel Verkamp Commit-Queue: Grzegorz Jaszczyk Tested-by: kokoro --- vm_control/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vm_control/src/lib.rs b/vm_control/src/lib.rs index 251980880f..3b50f43b39 100644 --- a/vm_control/src/lib.rs +++ b/vm_control/src/lib.rs @@ -1041,8 +1041,8 @@ impl VmRequest { VmResponse::Ok } VmRequest::Powerbtn => { - if pm.is_some() { - pm.as_ref().unwrap().lock().pwrbtn_evt(); + if let Some(pm) = pm { + pm.lock().pwrbtn_evt(); VmResponse::Ok } else { error!("{:#?} not supported", *self);