Skip to content

Match ergonomics: examples/bin_packing.rs #251

@HunkBenny

Description

@HunkBenny

Code does not compile, because of:

// find the pair with the largest fractional value
let pair = pair_vals
.iter()
.filter(|(_, &val)| val.fract() > model.eps() && val < 1.0 - model.eps())
.max_by(|a, b| a.1.partial_cmp(b.1).unwrap())
.unwrap()
.0;

Within the filter function call, the reference pattern needs to be made explicit. More here.

Thought this could be a simple first contribution for me! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions