cargo fmt
This commit is contained in:
parent
41610c51ca
commit
fa9a50b60e
1 changed files with 13 additions and 19 deletions
26
src/main.rs
26
src/main.rs
|
@ -96,20 +96,16 @@ fn main() {
|
|||
// create necessary variables
|
||||
let ver = TransformVersion::Version1;
|
||||
|
||||
|
||||
// StartData and TypeData are always present
|
||||
|
||||
// ENCODE: StartData
|
||||
StartData(ver)
|
||||
.encode(ver, &mut out)
|
||||
.unwrap();
|
||||
StartData(ver).encode(ver, &mut out).unwrap();
|
||||
|
||||
// ENCODE: TypeData
|
||||
TypeData(ItemType::from(loaded_config.item_type))
|
||||
.encode(ver, &mut out)
|
||||
.unwrap();
|
||||
|
||||
|
||||
// ENCODE: ALotOfStuff
|
||||
// Also print any mapped errors
|
||||
if let Err(e) = cook(
|
||||
|
@ -124,15 +120,10 @@ fn main() {
|
|||
};
|
||||
|
||||
// ENCODE: EndData
|
||||
EndData
|
||||
.encode(ver, &mut out)
|
||||
.unwrap();
|
||||
EndData.encode(ver, &mut out).unwrap();
|
||||
|
||||
// final string print
|
||||
println!("{}", encode_string(&out));
|
||||
|
||||
|
||||
|
||||
}
|
||||
Err(e) => println!("{}", e),
|
||||
}
|
||||
|
@ -144,9 +135,14 @@ fn main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
fn cook(debug_mode: &bool, json_config: Jsonconfig, idsmap: HashMap<String, u8>, json_shiny: Vec<Shinystruct>, out: &mut Vec<u8>, ver: TransformVersion) -> Result<(), Errorfr> {
|
||||
|
||||
|
||||
fn cook(
|
||||
debug_mode: &bool,
|
||||
json_config: Jsonconfig,
|
||||
idsmap: HashMap<String, u8>,
|
||||
json_shiny: Vec<Shinystruct>,
|
||||
out: &mut Vec<u8>,
|
||||
ver: TransformVersion,
|
||||
) -> Result<(), Errorfr> {
|
||||
// ENCODE: NameData
|
||||
NameData(json_config.name.trim().to_string())
|
||||
.encode(ver, out)
|
||||
|
@ -218,7 +214,6 @@ fn cook(debug_mode: &bool, json_config: Jsonconfig, idsmap: HashMap<String, u8>,
|
|||
.encode(ver, out)
|
||||
.unwrap();
|
||||
|
||||
|
||||
if let Some(rerollcount) = json_config.rerolls {
|
||||
if rerollcount != 0 {
|
||||
// ENCODE: RerollData if applicable
|
||||
|
@ -259,7 +254,6 @@ fn cook(debug_mode: &bool, json_config: Jsonconfig, idsmap: HashMap<String, u8>,
|
|||
// prints (Water,6) 255 times
|
||||
// println!("{:?}",vec![(Powders::WATER, 6); 255]);
|
||||
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue