diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-18 15:52:12 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-18 15:52:12 +0200 |
commit | 1bff001db2914e8ee7bc331a4104592ad6e2e9a3 (patch) | |
tree | 28b12471e0dc905a8135123df8ddf400c24ed8b2 /server/src/entity/customers/demands.rs | |
parent | 1dd3f549debdffd85639d74248a12dd884c5a59b (diff) | |
download | hurrycurry-1bff001db2914e8ee7bc331a4104592ad6e2e9a3.tar hurrycurry-1bff001db2914e8ee7bc331a4104592ad6e2e9a3.tar.bz2 hurrycurry-1bff001db2914e8ee7bc331a4104592ad6e2e9a3.tar.zst |
clippy
Diffstat (limited to 'server/src/entity/customers/demands.rs')
-rw-r--r-- | server/src/entity/customers/demands.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/server/src/entity/customers/demands.rs b/server/src/entity/customers/demands.rs index fa7e0dbf..4f15f86f 100644 --- a/server/src/entity/customers/demands.rs +++ b/server/src/entity/customers/demands.rs @@ -41,7 +41,7 @@ pub fn generate_demands( let prod_count = producable.len(); for r in &recipes { - let output_count = r.outputs().iter().filter(|o| !items.contains(&o)).count(); + let output_count = r.outputs().iter().filter(|o| !items.contains(o)).count(); let Some(ingred_cost) = r .inputs() .iter() @@ -79,16 +79,12 @@ pub fn generate_demands( raw_demands .iter() .filter_map(|(i, o, d)| { - if let Some(cost) = producable.get(i) { - Some(Demand { + producable.get(i).map(|cost| Demand { from: *i, to: *o, duration: *d, points: *cost as i64, }) - } else { - None - } }) .collect() } |