Browse Source

test-distro: appease unreachable code check

See https://github.com/rust-lang/rust/commit/ff6dc928c5e33ce8e65c6911a7.
Tamir Duberstein 2 weeks ago
parent
commit
29dc775535
1 changed files with 6 additions and 2 deletions
  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:?}")
+        }
+    }
 }