format code because xeon told me to
This commit is contained in:
parent
cba627ef63
commit
8bc131c7fe
1 changed files with 9 additions and 12 deletions
21
src/main.rs
21
src/main.rs
|
@ -8,7 +8,6 @@ use idmangler_lib::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::panic;
|
use std::panic;
|
||||||
use std::string::ToString;
|
use std::string::ToString;
|
||||||
|
@ -102,15 +101,11 @@ fn main() {
|
||||||
let mut powdervec = Vec::new();
|
let mut powdervec = Vec::new();
|
||||||
for eachpowder in json_config.powders {
|
for eachpowder in json_config.powders {
|
||||||
let powdertier = eachpowder.tier; // get the powder tier
|
let powdertier = eachpowder.tier; // get the powder tier
|
||||||
let powderamount: u8 = match eachpowder.amount {
|
let powderamount: u8 = eachpowder.amount.unwrap_or_else(|| 1);
|
||||||
// get amount of powder if exists, otherwise 1
|
|
||||||
Some(amount) => amount, // good,
|
|
||||||
None => 1, // bad,
|
|
||||||
};
|
|
||||||
// match for the powder type
|
// match for the powder type
|
||||||
// no need to return to variable or i'll need to rematch AGAIN
|
// no need to return to variable or i'll need to rematch AGAIN
|
||||||
match eachpowder.r#type {
|
match eachpowder.r#type.to_ascii_lowercase() {
|
||||||
'E' | 'e' => {
|
'e' => {
|
||||||
for _i in 0..powderamount {
|
for _i in 0..powderamount {
|
||||||
powdervec.push((Powders::EARTH, powdertier))
|
powdervec.push((Powders::EARTH, powdertier))
|
||||||
}
|
}
|
||||||
|
@ -118,7 +113,7 @@ fn main() {
|
||||||
println!("Powder type: Earth");
|
println!("Powder type: Earth");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'T' | 't' => {
|
't' => {
|
||||||
for _i in 0..powderamount {
|
for _i in 0..powderamount {
|
||||||
powdervec.push((Powders::THUNDER, powdertier))
|
powdervec.push((Powders::THUNDER, powdertier))
|
||||||
}
|
}
|
||||||
|
@ -126,7 +121,7 @@ fn main() {
|
||||||
println!("Powder type: Thunder");
|
println!("Powder type: Thunder");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'W' | 'w' => {
|
'w' => {
|
||||||
for _i in 0..powderamount {
|
for _i in 0..powderamount {
|
||||||
powdervec.push((Powders::WATER, powdertier))
|
powdervec.push((Powders::WATER, powdertier))
|
||||||
}
|
}
|
||||||
|
@ -134,7 +129,7 @@ fn main() {
|
||||||
println!("Powder type: Water");
|
println!("Powder type: Water");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'F' | 'f' => {
|
'f' => {
|
||||||
for _i in 0..powderamount {
|
for _i in 0..powderamount {
|
||||||
powdervec.push((Powders::FIRE, powdertier))
|
powdervec.push((Powders::FIRE, powdertier))
|
||||||
}
|
}
|
||||||
|
@ -142,7 +137,7 @@ fn main() {
|
||||||
println!("Powder type: Fire");
|
println!("Powder type: Fire");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'A' | 'a' => {
|
'a' => {
|
||||||
for _i in 0..powderamount {
|
for _i in 0..powderamount {
|
||||||
powdervec.push((Powders::AIR, powdertier))
|
powdervec.push((Powders::AIR, powdertier))
|
||||||
}
|
}
|
||||||
|
@ -193,6 +188,7 @@ fn main() {
|
||||||
if let Some(shiny) = json_config.shiny {
|
if let Some(shiny) = json_config.shiny {
|
||||||
if let ref shinykey = shiny.key {
|
if let ref shinykey = shiny.key {
|
||||||
if let shinyvalue = shiny.value {
|
if let shinyvalue = shiny.value {
|
||||||
|
|
||||||
realshinykey = 1;
|
realshinykey = 1;
|
||||||
for i in json_shiny {
|
for i in json_shiny {
|
||||||
if i.key == shiny.key {
|
if i.key == shiny.key {
|
||||||
|
@ -214,6 +210,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
.encode(ver, &mut out)
|
.encode(ver, &mut out)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue