Skip to content

Commit f431775

Browse files
alexdewarCopilot
andauthored
Fix doc comment
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 965acca commit f431775

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/simulation/investment/appraisal.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,10 @@ fn compare_asset_fallback(asset1: &Asset, asset2: &Asset) -> Ordering {
365365
/// are preferred over uncommissioned assets, and newer assets are preferred over older
366366
/// ones. The function does not guarantee that all ties will be resolved.
367367
///
368-
/// Assets with zero capacity are filtered out before sorting,
369-
/// as their metric would be `NaN` and could cause the program to panic. So the length
370-
/// of the returned vector may be less than the input.
368+
/// Before sorting, outputs are filtered using [`AppraisalOutput::is_valid`], which
369+
/// excludes entries with invalid metrics (e.g. `None`) as well as zero capacity. This
370+
/// avoids meaningless or `NaN` appraisal metrics that could cause the program to panic,
371+
/// so the length of the returned vector may be less than the input.
371372
pub fn sort_appraisal_outputs_by_investment_priority(outputs_for_opts: &mut Vec<AppraisalOutput>) {
372373
outputs_for_opts.retain(AppraisalOutput::is_valid);
373374
outputs_for_opts.sort_by(|output1, output2| match output1.compare_metric(output2) {

0 commit comments

Comments
 (0)