diff --git a/ica-rs/Cargo.toml b/ica-rs/Cargo.toml index 3cf45bc5..03b0c91c 100644 --- a/ica-rs/Cargo.toml +++ b/ica-rs/Cargo.toml @@ -13,4 +13,4 @@ rust_socketio = "0.4.4" serde_json = "1.0.108" [patch.crates-io] -rust_socketio = { path = "V:/githubs/rust-socketio/socketio" } \ No newline at end of file +rust_socketio = { path = "../../../rust-socketio/socketio" } \ No newline at end of file diff --git a/ica-rs/src/main.rs b/ica-rs/src/main.rs index 74ee1fd2..405715ba 100644 --- a/ica-rs/src/main.rs +++ b/ica-rs/src/main.rs @@ -48,9 +48,10 @@ fn ws_main() { let connect_call_back = |payload: Payload, _client: RawClient, _id| { match payload { Payload::Text(values) => { - if values.first() == Some(&Value::String("authSucceed".to_string())) { - // 一个绿色的 "已经连接到 icalingua 服务器" - println!("\x1b[32m已经登录到 icalingua!\x1b[0m"); + if let Some(value) = values.first() { + if let Some("authSucceed") = value.as_str() { + println!("\x1b[32m已经登录到 icalingua!\x1b[0m"); + } } }, _ => ()