使用读写锁简化操作,增加延迟优先选项

This commit is contained in:
lubeilin
2023-10-31 20:48:38 +08:00
parent d2e09d3da5
commit b0c3f25a29
10 changed files with 96 additions and 269 deletions
+3
View File
@@ -33,6 +33,7 @@ pub struct FileConfig {
pub punch_model: String,
pub port: u16,
pub cmd: bool,
pub first_latency: bool,
}
impl Default for FileConfig {
@@ -64,6 +65,7 @@ impl Default for FileConfig {
punch_model: "".to_string(),
port: 0,
cmd: false,
first_latency: false,
}
}
}
@@ -155,6 +157,7 @@ pub fn read_config(file_path: &str) -> io::Result<(Config, bool)> {
file_conf.finger,
punch_model,
file_conf.port,
file_conf.first_latency,
);
Ok((config, file_conf.cmd))
}