Explorar el Código

系统层判断遇到panic直接退出

skyfffire hace 2 años
padre
commit
eb6a301827
Se han modificado 1 ficheros con 1 adiciones y 3 borrados
  1. 1 3
      src/control_c.rs

+ 1 - 3
src/control_c.rs

@@ -2,13 +2,11 @@ use std::sync::Arc;
 use std::sync::atomic::{AtomicBool, Ordering};
 use tracing::info;
 
-pub fn exit_handler(running: Arc<AtomicBool>) -> Arc<AtomicBool> {
+pub fn exit_handler(running: Arc<AtomicBool>) {
     let r = running.clone();
     ctrlc::set_handler(move || {
         info!("检测到退出信号!");
         r.store(false, Ordering::Relaxed);
     })
     .expect("Error setting Ctrl-C handler");
-
-    return running;
 }