Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minmax set (prev "Add {min,max}_set(_by{_key)?)? functions") #613

Merged
merged 8 commits into from May 23, 2022

Commits on May 4, 2022

  1. FEAT: Add {min,max}_set(_by{_key)?)? functions

    The function min_set returns a Vec of all the minimum values. All
    variants for max and with key extraction and comparison functions are
    added also.
    
    Since the functions need to return an unknown number of values and the
    values are not known until the iterator is finished, the function
    needs to allocate memory. Therefore Vec is used for returning the
    values.
    zayenz authored and phimuemue committed May 4, 2022
    Copy the full SHA
    e8c67ef View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    bb8b41a View commit details
    Browse the repository at this point in the history
  3. Add {min,max}_set(_by{_key)?)? functions (3) use Ord instead of Parti…

    …alOrd
    
    We may relax this bound at some point, but I'd go with this until we
    have evidence that it bothers users, as there have been cases where I
     actually was happy to be informed about Ord vs PartialOrd.
    phimuemue committed May 4, 2022
    Copy the full SHA
    491b34a View commit details
    Browse the repository at this point in the history
  4. Add {min,max}_set(_by{_key)?)? functions (4) use internal iteration

    We may relax this bound at some point, but I'd go with this until we
    have evidence that it bothers users, as there have been cases where I
     actually was happy to be informed about Ord vs PartialOrd.
    phimuemue committed May 4, 2022
    Copy the full SHA
    834bcc5 View commit details
    Browse the repository at this point in the history
  5. Add {min,max}_set(_by{_key)?)? functions (5) comparator uses Ordering…

    … instead of bool
    
    More canonical.
    phimuemue committed May 4, 2022
    Copy the full SHA
    6f96e01 View commit details
    Browse the repository at this point in the history
  6. Add {min,max}_set(_by{_key)?)? functions (6) inline bulk into match arm

    Slightly simplifies control flow as it avoids mutable variables that may
    not even be used in case of early return.
    phimuemue committed May 4, 2022
    Copy the full SHA
    fb57fc6 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    08a10da View commit details
    Browse the repository at this point in the history

Commits on May 21, 2022

  1. Add {min,max}_set(_by{_key)?)? functions (8) add quickcheck tests

    the {min,max}_set results must contain the result of the corresponding
    {min,max} variant.
    phimuemue committed May 21, 2022
    Copy the full SHA
    846219f View commit details
    Browse the repository at this point in the history