调整代码格式和样式

This commit is contained in:
shenjack 2024-02-25 01:33:56 +08:00
parent 8b2a8ee8d2
commit 4b3da3b85f
Signed by: shenjack
GPG Key ID: 7B1134A979775551
4 changed files with 5 additions and 13 deletions

View File

@ -3,7 +3,7 @@
# 最大行长 # 最大行长
max_width = 100 max_width = 100
# 链式调用的最大长度 # 链式调用的最大长度
chain_width = 70 chain_width = 80
# 数组的最大长度 # 数组的最大长度
array_width = 70 array_width = 70
# 函数参数的最大长度 # 函数参数的最大长度

View File

@ -28,10 +28,7 @@ pub async fn add_message(payload: Payload, client: Client) {
if let Some(value) = values.first() { if let Some(value) = values.first() {
let message: NewMessage = serde_json::from_value(value.clone()).unwrap(); let message: NewMessage = serde_json::from_value(value.clone()).unwrap();
// 检测是否在过滤列表内 // 检测是否在过滤列表内
if IcalinguaStatus::get_config() if IcalinguaStatus::get_config().filter_list.contains(&message.msg.sender_id) {
.filter_list
.contains(&message.msg.sender_id)
{
return; return;
} }
info!("add_message {}", message.to_string().cyan()); info!("add_message {}", message.to_string().cyan());

View File

@ -75,9 +75,8 @@ async fn main() {
); );
std::thread::sleep(Duration::from_secs(1)); std::thread::sleep(Duration::from_secs(1));
info!("发送启动消息到房间: {}", room); info!("发送启动消息到房间: {}", room);
if let Err(e) = socket if let Err(e) =
.emit("sendMessage", serde_json::to_value(startup_msg).unwrap()) socket.emit("sendMessage", serde_json::to_value(startup_msg).unwrap()).await
.await
{ {
info!("启动信息发送失败 房间:{}|e:{}", room, e); info!("启动信息发送失败 房间:{}|e:{}", room, e);
} }

View File

@ -107,11 +107,7 @@ pub fn load_py_plugins(path: &PathBuf) {
pub fn verify_plugins() { pub fn verify_plugins() {
let mut need_reload_files: Vec<PathBuf> = Vec::new(); let mut need_reload_files: Vec<PathBuf> = Vec::new();
let plugin_path = IcalinguaStatus::get_config() let plugin_path = IcalinguaStatus::get_config().py_plugin_path.as_ref().unwrap().to_owned();
.py_plugin_path
.as_ref()
.unwrap()
.to_owned();
for entry in std::fs::read_dir(&plugin_path).unwrap() { for entry in std::fs::read_dir(&plugin_path).unwrap() {
if let Ok(entry) = entry { if let Ok(entry) = entry {
let path = entry.path(); let path = entry.path();