Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikachu2333 authored Dec 31, 2024
1 parent e38b19a commit cc15e85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "SC_Starter"
version = "1.9.1"
version = "1.9.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
22 changes: 5 additions & 17 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,23 +287,11 @@ fn read_config(conf_path: &PathBuf, default_settings: &SettingsCollection) -> Se
//println!("{:?}",&full_content[0..4]);
//println!("{:?}",&full_content[5]);
let useful_content: Vec<&str> = full_content[0..4].to_vec();
let mut useful_path = full_content[4]
.to_string()
.replace("'", "")
.replace("\"", "") //引号删了
.replace("\\", "/") //反斜杠转换为斜杠
.replace("//", "/");
while useful_path.starts_with(" ") || useful_path.ends_with(" ") || useful_path.ends_with("/") {
//删除所有开头和结尾的空格
useful_path = useful_path
.strip_prefix(" ")
.unwrap()
.strip_prefix(" ")
.unwrap()
.strip_suffix("/")
.unwrap()
.to_string();
}
let useful_path = {
let temp = full_content[4].replace("\\", "/").replace("//", "/");
temp.trim_matches(['\\', '/', '\n', '\r', '"', '\'', ' ', '\t'])
.to_string()
};

//这个闭包接收两个String然后返回一个包装好的KeyStringGroups类型便于下面解析
let struct_pack = |x: Vec<String>, y: String| KeyStringGroups {
Expand Down

0 comments on commit cc15e85

Please sign in to comment.