forked from StrafesNET/map-tool
fix int parsing
This commit is contained in:
parent
327d0a4992
commit
01449b1850
@ -108,7 +108,7 @@ fn get_allowed_map() -> Result<std::collections::HashMap::<u32,String>, Box<dyn
|
||||
let mut allowed_map = std::collections::HashMap::<u32,String>::new();
|
||||
for entry in std::fs::read_dir("scripts/allowed")? {
|
||||
let entry=entry?;
|
||||
allowed_map.insert(entry.file_name().to_str().unwrap().parse::<u32>()?,std::fs::read_to_string(entry.path())?);
|
||||
allowed_map.insert(entry.path().file_stem().unwrap().to_str().unwrap().parse::<u32>()?,std::fs::read_to_string(entry.path())?);
|
||||
}
|
||||
Ok(allowed_map)
|
||||
}
|
||||
@ -117,7 +117,7 @@ fn get_replace_map() -> Result<std::collections::HashMap::<String,u32>, Box<dyn
|
||||
let mut replace = std::collections::HashMap::<String,u32>::new();
|
||||
for entry in std::fs::read_dir("scripts/replace")? {
|
||||
let entry=entry?;
|
||||
replace.insert(std::fs::read_to_string(entry.path())?,entry.file_name().to_str().unwrap().parse::<u32>()?);
|
||||
replace.insert(std::fs::read_to_string(entry.path())?,entry.path().file_stem().unwrap().to_str().unwrap().parse::<u32>()?);
|
||||
}
|
||||
Ok(replace)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user