diff --git a/ica-rs/rustfmt.toml b/ica-rs/rustfmt.toml index 070df82..24a1762 100644 --- a/ica-rs/rustfmt.toml +++ b/ica-rs/rustfmt.toml @@ -3,7 +3,7 @@ # 最大行长 max_width = 100 # 链式调用的最大长度 -chain_width = 70 +chain_width = 80 # 数组的最大长度 array_width = 70 # 函数参数的最大长度 diff --git a/ica-rs/src/events.rs b/ica-rs/src/events.rs index b5c4647..fd4e77b 100644 --- a/ica-rs/src/events.rs +++ b/ica-rs/src/events.rs @@ -28,10 +28,7 @@ pub async fn add_message(payload: Payload, client: Client) { if let Some(value) = values.first() { let message: NewMessage = serde_json::from_value(value.clone()).unwrap(); // 检测是否在过滤列表内 - if IcalinguaStatus::get_config() - .filter_list - .contains(&message.msg.sender_id) - { + if IcalinguaStatus::get_config().filter_list.contains(&message.msg.sender_id) { return; } info!("add_message {}", message.to_string().cyan()); diff --git a/ica-rs/src/main.rs b/ica-rs/src/main.rs index ef2037d..56c1f3c 100644 --- a/ica-rs/src/main.rs +++ b/ica-rs/src/main.rs @@ -75,9 +75,8 @@ async fn main() { ); std::thread::sleep(Duration::from_secs(1)); info!("发送启动消息到房间: {}", room); - if let Err(e) = socket - .emit("sendMessage", serde_json::to_value(startup_msg).unwrap()) - .await + if let Err(e) = + socket.emit("sendMessage", serde_json::to_value(startup_msg).unwrap()).await { info!("启动信息发送失败 房间:{}|e:{}", room, e); } diff --git a/ica-rs/src/py/mod.rs b/ica-rs/src/py/mod.rs index 049b797..5d3c911 100644 --- a/ica-rs/src/py/mod.rs +++ b/ica-rs/src/py/mod.rs @@ -107,11 +107,7 @@ pub fn load_py_plugins(path: &PathBuf) { pub fn verify_plugins() { let mut need_reload_files: Vec = Vec::new(); - let plugin_path = IcalinguaStatus::get_config() - .py_plugin_path - .as_ref() - .unwrap() - .to_owned(); + let plugin_path = IcalinguaStatus::get_config().py_plugin_path.as_ref().unwrap().to_owned(); for entry in std::fs::read_dir(&plugin_path).unwrap() { if let Ok(entry) = entry { let path = entry.path();