summary refs log tree commit diff
path: root/x86_64
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2019-10-16 12:54:20 -0700
committerCommit Bot <commit-bot@chromium.org>2019-11-08 22:18:14 +0000
commit7a5a7fc44ffc434192d109b1d889a4f7037fab0c (patch)
treec37443fa618d411a24927d9df0c58624bff7eeaa /x86_64
parent2b109386e7676333a53b1511c12dce3a4ff329e3 (diff)
downloadcrosvm-7a5a7fc44ffc434192d109b1d889a4f7037fab0c.tar
crosvm-7a5a7fc44ffc434192d109b1d889a4f7037fab0c.tar.gz
crosvm-7a5a7fc44ffc434192d109b1d889a4f7037fab0c.tar.bz2
crosvm-7a5a7fc44ffc434192d109b1d889a4f7037fab0c.tar.lz
crosvm-7a5a7fc44ffc434192d109b1d889a4f7037fab0c.tar.xz
crosvm-7a5a7fc44ffc434192d109b1d889a4f7037fab0c.tar.zst
crosvm-7a5a7fc44ffc434192d109b1d889a4f7037fab0c.zip
arch: replace is_some + unwrap with `if let`
BUG=None
TEST=emerge-kevin crosvm

Change-Id: I78aa9f4fb4fb46de3394bb9bc2fa5a53e210fa0b
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1896085
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'x86_64')
-rw-r--r--x86_64/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs
index c866e56..c15221e 100644
--- a/x86_64/src/lib.rs
+++ b/x86_64/src/lib.rs
@@ -594,8 +594,8 @@ impl X8664arch {
     /// This returns a minimal kernel command for this architecture
     fn get_base_linux_cmdline(stdio_serial_num: Option<u8>) -> kernel_cmdline::Cmdline {
         let mut cmdline = kernel_cmdline::Cmdline::new(CMDLINE_MAX_SIZE as usize);
-        if stdio_serial_num.is_some() {
-            let tty_string = get_serial_tty_string(stdio_serial_num.unwrap());
+        if let Some(stdio_serial_num) = stdio_serial_num {
+            let tty_string = get_serial_tty_string(stdio_serial_num);
             cmdline.insert("console", &tty_string).unwrap();
         }
         cmdline.insert_str("noacpi reboot=k panic=-1").unwrap();