ccextractor icon indicating copy to clipboard operation
ccextractor copied to clipboard

fix(rust): revert is_multiple_of to maintain MSRV 1.54.0

Open DhanushVarma-2 opened this issue 3 months ago • 2 comments

Problem: The build was failing with Rust 1.54.0 due to use of is_multiple_of() method, which wasn't stable until Rust 1.90.0. This broke the project's stated Minimum Supported Rust Version (MSRV) of 1.54.0.

Root Cause: The is_multiple_of() method was introduced in #1753 to satisfy Clippy lints, but Clippy wasn't configured with the project's MSRV, causing it to suggest APIs unavailable in Rust 1.54.0.

Solution:

  1. Reverted unstable API: Changed is_multiple_of(2) back to stable % 2 == 0 check
  2. Added MSRV configuration: Created clippy.toml with msrv = "1.54.0" to prevent Clippy from suggesting incompatible APIs in the future

Changes Made

  • src/rust/src/es/pic.rs: Reverted is_multiple_of(2)% 2 == 0
  • src/rust/clippy.toml: Added MSRV configuration

Verification

  • Code change maintains identical logic (is_multiple_of(2)% 2 == 0)
  • Build should now work with Rust 1.54.0+
  • Clippy will now respect project MSRV when suggesting fixes

This fix maintains compatibility with the project's stated MSRV while preventing similar issues in the future.

Closes #1765

DhanushVarma-2 avatar Nov 21 '25 17:11 DhanushVarma-2

CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit b293017...:
Report Name Tests Passed
Broken 13/13
CEA-708 14/14
DVB 7/7
DVD 3/3
DVR-MS 2/2
General 27/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 85/86
Teletext 21/21
WTV 13/13
XDS 34/34

Your PR breaks these cases:

Congratulations: Merging this PR would fix the following tests:


It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Check the result page for more info.

ccextractor-bot avatar Dec 09 '25 10:12 ccextractor-bot

CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit b293017...:
Report Name Tests Passed
Broken 13/13
CEA-708 14/14
DVB 7/7
DVD 3/3
DVR-MS 2/2
General 27/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 86/86
Teletext 21/21
WTV 13/13
XDS 34/34

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --autoprogram --out=srt --latin1 f1422b8bfe..., Last passed: Never
  • ccextractor --datapid 5603 --autoprogram --out=srt --latin1 --teletext 85c7fc1ad7..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --quant 0 85271be4d2..., Last passed: Never
  • ccextractor --hardsubx 1a0302f7fd..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 c0d2fba8c0..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 006fdc391a..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 e92a1d4d2a..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 7e4ebf7fd7..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 9256a60e4b..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 27d7a43dd6..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 297a44921a..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 efbe129086..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 eae0077731..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 e2e2b501e0..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 c6407fb294..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 --datets dcada745de..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --tpage 398 5d5838bde9..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --teletext --tpage 398 3b276ad8bf..., Last passed: Never

All tests passing on the master branch were passed completely.

Check the result page for more info.

ccextractor-bot avatar Dec 09 '25 11:12 ccextractor-bot

Review Feedback

Thanks for working on this! We've decided to go with bumping the MSRV to 1.87.0 (the code already uses is_multiple_of() which requires it).

However, the PR title and description don't match what the code actually does:

  • Title says: "fix(rust): revert is_multiple_of to maintain MSRV 1.54.0"
  • PR actually does: Bumps MSRV from 1.54.0 to 1.87.0

This happened because the second commit reversed the first commit's intent.

Please update:

  1. Title → Something like: build: bump MSRV from 1.54.0 to 1.87.0
  2. Description → Update to reflect that we're bumping MSRV to support modern Rust features like is_multiple_of()

Once the title/description are updated to match the actual changes, this should be good to merge.

cfsmp3 avatar Dec 15 '25 07:12 cfsmp3