Browse Source

test-distro: appease unreachable code check

See https://github.com/rust-lang/rust/commit/ff6dc928c5e33ce8e65c6911a7.
Tamir Duberstein 2 tuần trước cách đây
mục cha
commit
29dc775535
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      test-distro/src/init.rs

+ 6 - 2
test-distro/src/init.rs

@@ -195,6 +195,10 @@ fn main() {
         }
     }
     let how = nix::sys::reboot::RebootMode::RB_POWER_OFF;
-    let _: std::convert::Infallible = nix::sys::reboot::reboot(how)
-        .unwrap_or_else(|err| panic!("reboot({how:?}) failed: {err:?}"));
+    match nix::sys::reboot::reboot(how) {
+        Ok(infallible) => match infallible {},
+        Err(err) => {
+            panic!("reboot({how:?}) failed: {err:?}")
+        }
+    }
 }