mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
as usual clippy is right (and helpful)
This commit is contained in:
parent
3a9e070ec0
commit
18f1cb9f43
@ -6,14 +6,12 @@ use veloren_world::site::economy::{self, good_list, Economy};
|
|||||||
fn good_name(g: Good) -> String {
|
fn good_name(g: Good) -> String {
|
||||||
let res = format!("{:?}", g);
|
let res = format!("{:?}", g);
|
||||||
let res = res.replace("(", "_");
|
let res = res.replace("(", "_");
|
||||||
let res = res.replace(")", "_");
|
res.replace(")", "_")
|
||||||
res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn labor_name(l: economy::Labor) -> String {
|
fn labor_name(l: economy::Labor) -> String {
|
||||||
let res = format!("{:?}", l);
|
let res = format!("{:?}", l);
|
||||||
let res = res.replace(" ", "_");
|
res.replace(" ", "_")
|
||||||
res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), std::io::Error> {
|
fn main() -> Result<(), std::io::Error> {
|
||||||
@ -32,14 +30,14 @@ fn main() -> Result<(), std::io::Error> {
|
|||||||
writeln!(f, "{:?} [color=\"{}\"];", good_name(*i), color)?; // shape doubleoctagon ?
|
writeln!(f, "{:?} [color=\"{}\"];", good_name(*i), color)?; // shape doubleoctagon ?
|
||||||
}
|
}
|
||||||
|
|
||||||
writeln!(f, "")?;
|
writeln!(f)?;
|
||||||
writeln!(f, "// Professions")?;
|
writeln!(f, "// Professions")?;
|
||||||
writeln!(f, "Everyone [shape=doubleoctagon];")?;
|
writeln!(f, "Everyone [shape=doubleoctagon];")?;
|
||||||
for i in economy::Labor::list() {
|
for i in economy::Labor::list() {
|
||||||
writeln!(f, "{:?} [shape=box];", labor_name(i))?;
|
writeln!(f, "{:?} [shape=box];", labor_name(i))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeln!(f, "")?;
|
writeln!(f)?;
|
||||||
writeln!(f, "// Orders")?;
|
writeln!(f, "// Orders")?;
|
||||||
for i in o.iter() {
|
for i in o.iter() {
|
||||||
for j in i.1.iter() {
|
for j in i.1.iter() {
|
||||||
@ -71,7 +69,7 @@ fn main() -> Result<(), std::io::Error> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
writeln!(f, "")?;
|
writeln!(f)?;
|
||||||
writeln!(f, "// Products")?;
|
writeln!(f, "// Products")?;
|
||||||
for i in p.iter() {
|
for i in p.iter() {
|
||||||
for j in i.1.iter() {
|
for j in i.1.iter() {
|
||||||
|
Loading…
Reference in New Issue
Block a user