Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Scary `.unwrap_or(MoneyPerFlow(0.0))`

Open
#1,359 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Quiet
Tech stack
rust
Domain
backend

Research direction

Start at get_revenue_from_flows_with_filter and trace how missing prices and unpriced commodities such as OTH are represented and consumed. Define an intentional rule for missing prices instead of assuming zero, then verify the affected revenue behavior across the relevant cases.

Written by the indexing model from the issue text.

Description

There's an .unwrap_or(MoneyPerFlow(0.0)) statement in get_revenue_from_flows_with_filter that I feel uneasy about every time I come across.

I don't think it's reasonable to broadly assume that if a price is missing then the price is zero. Not saying there's a bug here, as we probably are only doing this for commodities that are genuinely unpriced (e.g. OTH commodities), but I still think we should design this whole part of the code in a more intentional way, as otherwise it's easy to imagine a bug creeping in.

Dominant language
Rust
Stars
8
Forks
5
Avg merge
11h 31m
Merged PRs (30d)
33

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EnergySystemsModellingLab/MUSE2

All issues in EnergySystemsModellingLab/MUSE2

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.