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 <dverkamp@chromium.org>
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Grzegorz Jaszczyk 2022-04-29 17:39:10 +00:00 committed by Chromeos LUCI
parent ae70c7f3e9
commit 6b8680bc15

View file

@ -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);