remove comments. also cargo fmt
This commit is contained in:
parent
ebeb57b3fa
commit
8d46acb705
1 changed files with 5 additions and 12 deletions
15
src/main.rs
15
src/main.rs
|
@ -244,31 +244,24 @@ fn cook(
|
||||||
// ENCODE: ShinyData (if applicable)
|
// ENCODE: ShinyData (if applicable)
|
||||||
ShinyData {
|
ShinyData {
|
||||||
id: realshinykey,
|
id: realshinykey,
|
||||||
val: shinyvalue, //- 0b0100_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000,
|
val: shinyvalue,
|
||||||
// u16::MAX is the max value of unsigned 16bit value
|
|
||||||
}
|
}
|
||||||
.encode(ver, out)
|
.encode(ver, out)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// prints (Water,6) 255 times
|
|
||||||
// println!("{:?}",vec![(Powders::WATER, 6); 255]);
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_jsonconfig(path: &String) -> Result<Jsonconfig, Errorfr> {
|
fn load_jsonconfig(path: &String) -> Result<Jsonconfig, Errorfr> {
|
||||||
serde_json5::from_reader(
|
serde_json5::from_reader(&mut fs::File::open(path).map_err(|_| Errorfr::ItemJsonMissing)?)
|
||||||
&mut fs::File::open(path)
|
|
||||||
.map_err(|_| Errorfr::ItemJsonMissing)?
|
|
||||||
)
|
|
||||||
.map_err(|e| Errorfr::ItemJsonCorrupt(e))
|
.map_err(|e| Errorfr::ItemJsonCorrupt(e))
|
||||||
}
|
}
|
||||||
fn load_idkeys(executable_path: &str) -> Result<HashMap<String, u8>, Errorfr> {
|
fn load_idkeys(executable_path: &str) -> Result<HashMap<String, u8>, Errorfr> {
|
||||||
// id_keys.json
|
// id_keys.json
|
||||||
serde_json5::from_reader(
|
serde_json5::from_reader(
|
||||||
&mut fs::File::open(executable_path.to_owned() + "/id_keys.json")
|
&mut fs::File::open(executable_path.to_owned() + "/id_keys.json")
|
||||||
.map_err(|_| Errorfr::IDMapJsonMissing)?
|
.map_err(|_| Errorfr::IDMapJsonMissing)?,
|
||||||
)
|
)
|
||||||
.map_err(|_| Errorfr::IDMapJsonCorrupt)
|
.map_err(|_| Errorfr::IDMapJsonCorrupt)
|
||||||
}
|
}
|
||||||
|
@ -276,7 +269,7 @@ fn load_shinystats(executable_path: &str) -> Result<Vec<Shinystruct>, Errorfr> {
|
||||||
// shiny_stats.json
|
// shiny_stats.json
|
||||||
serde_json5::from_reader(
|
serde_json5::from_reader(
|
||||||
&mut fs::File::open(executable_path.to_owned() + "/shiny_stats.json")
|
&mut fs::File::open(executable_path.to_owned() + "/shiny_stats.json")
|
||||||
.map_err(|_| Errorfr::ShinyJsonMissing)?
|
.map_err(|_| Errorfr::ShinyJsonMissing)?,
|
||||||
)
|
)
|
||||||
.map_err(|_| Errorfr::ShinyJsonCorrupt)
|
.map_err(|_| Errorfr::ShinyJsonCorrupt)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue