From 546214f52fa32c8a32973c18377e3e76fd6f7d08 Mon Sep 17 00:00:00 2001 From: shenjack-5600u <3695888@qq.com> Date: Wed, 9 Apr 2025 23:14:17 +0800 Subject: [PATCH] =?UTF-8?q?fmt=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ica-rs/src/py/class.rs | 49 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/ica-rs/src/py/class.rs b/ica-rs/src/py/class.rs index 3bfdc3c..5113712 100644 --- a/ica-rs/src/py/class.rs +++ b/ica-rs/src/py/class.rs @@ -105,7 +105,12 @@ impl ConfigStoragePy { list.push(ConfigItemPy::new_uninit(ConfigItem::Table(new_map))); } Err(e) => { - event!(Level::WARN, "value(dict) 解析时出现错误: {}\nraw: {}", e, value); + event!( + Level::WARN, + "value(dict) 解析时出现错误: {}\nraw: {}", + e, + value + ); } } } else if value_type.is_instance_of::() { @@ -116,7 +121,12 @@ impl ConfigStoragePy { list.push(ConfigItemPy::new_uninit(ConfigItem::Array(new_list))); } Err(e) => { - event!(Level::WARN, "value(list) 解析时出现错误: {}\nraw: {}", e, value); + event!( + Level::WARN, + "value(list) 解析时出现错误: {}\nraw: {}", + e, + value + ); } } } else if value_type.is_instance_of::() { @@ -125,7 +135,12 @@ impl ConfigStoragePy { list.push(ConfigItemPy::new_uninit(ConfigItem::String(value))); } Err(e) => { - event!(Level::WARN, "value(string) 解析时出现错误: {}\nraw: {}", e, value); + event!( + Level::WARN, + "value(string) 解析时出现错误: {}\nraw: {}", + e, + value + ); } } } else if value_type.is_instance_of::() { @@ -134,7 +149,12 @@ impl ConfigStoragePy { list.push(ConfigItemPy::new_uninit(ConfigItem::Bool(value))); } Err(e) => { - event!(Level::WARN, "value(bool) 解析时出现错误: {}\nraw: {}", e, value); + event!( + Level::WARN, + "value(bool) 解析时出现错误: {}\nraw: {}", + e, + value + ); } } } else if value_type.is_instance_of::() { @@ -152,17 +172,32 @@ impl ConfigStoragePy { list.push(ConfigItemPy::new_uninit(ConfigItem::Float(value))); } Err(e) => { - event!(Level::WARN, "value(float) 解析时出现错误: {}\nraw: {}", e, value); + event!( + Level::WARN, + "value(float) 解析时出现错误: {}\nraw: {}", + e, + value + ); } } } else { // 先丢个 warning 出去 match value_type.name() { Ok(type_name) => { - event!(Level::WARN, "value 为不支持的 {} 类型\nraw: {}", type_name, value) + event!( + Level::WARN, + "value 为不支持的 {} 类型\nraw: {}", + type_name, + value + ) } Err(e) => { - event!(Level::WARN, "value 为不支持的类型 (获取类型名失败: {})\nraw: {}", e, value) + event!( + Level::WARN, + "value 为不支持的类型 (获取类型名失败: {})\nraw: {}", + e, + value + ) } } }