aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/customers/demands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/entity/customers/demands.rs')
-rw-r--r--server/src/entity/customers/demands.rs8
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()
}