Update Rust version: fix console window, add API test, update README

This commit is contained in:
2026-04-07 17:27:38 +08:00
parent e065c41d6b
commit 3ae0eaa9c1
7 changed files with 612 additions and 212 deletions

35
rust/build.rs Normal file
View File

@@ -0,0 +1,35 @@
use std::io;
#[cfg(windows)]
fn main() -> io::Result<()> {
// 设置Windows子系统为windows不显示控制台
let mut res = winres::WindowsResource::new();
// 设置应用程序图标 - 使用项目根目录的图标
let icon_path = std::path::Path::new("../guba.ico");
if icon_path.exists() {
res.set_icon("../guba.ico");
println!("cargo:rerun-if-changed=../guba.ico");
} else {
println!("cargo:warning=图标文件未找到: ../guba.ico");
}
// 设置文件属性
res.set_language(0x0804); // 中文(简体)
res.set("FileDescription", "股吧人气指示器");
res.set("ProductName", "股吧人气指示器");
res.set("OriginalFilename", "guba.exe");
res.set("InternalName", "guba");
res.set("CompanyName", "Guba Developer");
res.set("LegalCopyright", "Copyright (C) 2024");
// 关键设置Windows子系统为windowsGUI程序不显示控制台
res.set("Subsystem", "windows");
res.compile()
}
#[cfg(not(windows))]
fn main() {
// 非Windows平台不需要特殊处理
}