itertools icon indicating copy to clipboard operation
itertools copied to clipboard

Migrate to edition 2021

Open Philippe-Cholet opened this issue 1 year ago • 4 comments

I noted 5 months ago that edition 2021 requires rustc 1.56+ so it's now possible. Is there any reason to not update?

Philippe-Cholet avatar Jul 04 '24 10:07 Philippe-Cholet

Codecov Report

:x: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review. :white_check_mark: Project coverage is 93.65%. Comparing base (6814180) to head (fde1ad9). :warning: Report is 168 commits behind head on master.

Files with missing lines Patch % Lines
src/adaptors/mod.rs 91.66% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #967      +/-   ##
==========================================
- Coverage   94.38%   93.65%   -0.74%     
==========================================
  Files          48       50       +2     
  Lines        6665     6323     -342     
==========================================
- Hits         6291     5922     -369     
- Misses        374      401      +27     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jul 04 '24 10:07 codecov[bot]

I added some marginal changes:

  • MSRV automated in the crate documentation (valid for a MSRV >= 1.63.0).
  • Fix some additional clippy lints, mostly related to the recent MSRV/edition changes.
  • Use ControlFlow?!

@jswrenn I remember your https://github.com/rust-itertools/itertools/pull/780#discussion_r1352664093 where you prefered ControlFlow over Result, I replaced some, left some aside for now. Can you elaborate on the reason?

Philippe-Cholet avatar Jul 04 '24 12:07 Philippe-Cholet

I remember your #780 (comment) where you prefered ControlFlow over Result, I replaced some, left some aside for now. Can you elaborate on the reason?

Result::Err denotes "something went wrong"; ControlFlow::Break doesn't. Favor ControlFlow when we're trying to encode conditional iteration without judgement about error-ness, and favor Result when you're specifically dealing with an early return due to error.

jswrenn avatar Aug 02 '24 14:08 jswrenn

@Philippe-Cholet is this good to merge?

jswrenn avatar Oct 22 '24 13:10 jswrenn

haha, it's been nearly ten months since the 2024 Edition was released. Maybe we can migrate a bit more

Natural-selection1 avatar Nov 12 '25 05:11 Natural-selection1