cargo fmt

This commit is contained in:
endernon 2024-12-31 16:27:33 +00:00
parent 41610c51ca
commit fa9a50b60e

View file

@ -96,20 +96,16 @@ fn main() {
// create necessary variables // create necessary variables
let ver = TransformVersion::Version1; let ver = TransformVersion::Version1;
// StartData and TypeData are always present // StartData and TypeData are always present
// ENCODE: StartData // ENCODE: StartData
StartData(ver) StartData(ver).encode(ver, &mut out).unwrap();
.encode(ver, &mut out)
.unwrap();
// ENCODE: TypeData // ENCODE: TypeData
TypeData(ItemType::from(loaded_config.item_type)) TypeData(ItemType::from(loaded_config.item_type))
.encode(ver, &mut out) .encode(ver, &mut out)
.unwrap(); .unwrap();
// ENCODE: ALotOfStuff // ENCODE: ALotOfStuff
// Also print any mapped errors // Also print any mapped errors
if let Err(e) = cook( if let Err(e) = cook(
@ -124,15 +120,10 @@ fn main() {
}; };
// ENCODE: EndData // ENCODE: EndData
EndData EndData.encode(ver, &mut out).unwrap();
.encode(ver, &mut out)
.unwrap();
// final string print // final string print
println!("{}", encode_string(&out)); println!("{}", encode_string(&out));
} }
Err(e) => println!("{}", e), 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 // ENCODE: NameData
NameData(json_config.name.trim().to_string()) NameData(json_config.name.trim().to_string())
.encode(ver, out) .encode(ver, out)
@ -218,7 +214,6 @@ fn cook(debug_mode: &bool, json_config: Jsonconfig, idsmap: HashMap<String, u8>,
.encode(ver, out) .encode(ver, out)
.unwrap(); .unwrap();
if let Some(rerollcount) = json_config.rerolls { if let Some(rerollcount) = json_config.rerolls {
if rerollcount != 0 { if rerollcount != 0 {
// ENCODE: RerollData if applicable // 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 // prints (Water,6) 255 times
// println!("{:?}",vec![(Powders::WATER, 6); 255]); // println!("{:?}",vec![(Powders::WATER, 6); 255]);
Ok(()) Ok(())
} }